PageSourceSearch

https://www.wowsystems.pt/assets/PortfolioList-BNJWC2eO.js

js wowsystems.pt collected 2026-10-05 22:49:22 UTC 6,869 bytes, 11 lines download raw bytes

1import{c as h,r as i,j as e,L as u,m as y,q as n}from"./index-IKiEBAPu.js";import{s as l}from"./client-B2znzKer.js";import{A as P}from"./AdminLayout-D1NkKtiC.js";import{B as s,I as k}from"./label-BfJ44SHj.js";import{p as L}from"./projects-exmSYCKv.js";import{P as _,E as q}from"./plus-DjWadu9M.js";import{S,T as C}from"./trash-2-fgYTMX1j.js";import{I as E}from"./image-Ypp3F4Lv.js";import{E as z,S as I}from"./square-pen-CdOQQCjU.js";import"./chevron-right-0yhKdZS8.js";import"./external-link-DG1AxS8B.js";import"./psiprof-cover-Dw4FiHhB.js";/**
2 * @license lucide-react v0.462.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const A=h("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/**
7 * @license lucide-react v0.462.0 - ISC
8 *
9 * This source code is licensed under the ISC license.
10 * See the LICENSE file in the root directory of this source tree.
11 */const x=h("Star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]),M=()=>{const[c,g]=i.useState([]),[f,p]=i.useState(!0),[d,j]=i.useState(""),a=async()=>{const{data:t,error:r}=await l.from("portfolio_projects").select("id, slug, title_pt, category, published, featured, created_at, image_url").order("sort_order",{ascending:!0});if(r){console.error(r);return}g(t||[]),p(!1)};i.useEffect(()=>{a()},[]);const b=async(t,r)=>{await l.from("portfolio_projects").update({published:!r}).eq("id",t),a(),n.success(r?"Projeto despublicado":"Projeto publicado")},w=async(t,r)=>{await l.from("portfolio_projects").update({featured:!r}).eq("id",t),a(),n.success(r?"Removido de destaque":"Adicionado como destaque")},N=async t=>{confirm("Tens a certeza que queres apagar este projeto?")&&(await l.from("portfolio_projects").delete().eq("id",t),a(),n.success("Projeto apagado"))},v=t=>{if(t.image_url)return t.image_url;const r=L.find(o=>o.slug===t.slug);return(r==null?void 0:r.image)||null},m=c.filter(t=>t.title_pt.toLowerCase().includes(d.toLowerCase())||t.category.toLowerCase().includes(d.toLowerCase()));return e.jsxs(P,{children:[e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Portfólio"}),e.jsxs("p",{className:"text-sm text-muted-foreground/40 mt-1",children:[c.length," projetos"]})]}),e.jsx(u,{to:"/admin/portfolio/new",children:e.jsxs(s,{className:"gap-2 rounded-xl h-10 px-5 bg-primary hover:bg-primary/90 shadow-lg shadow-primary/10 font-semibold text-[13px]",children:[e.jsx(_,{className:"w-4 h-4"})," Novo Projeto"]})})]}),e.jsxs("div",{className:"relative mb-5",children:[e.jsx(S,{className:"absolute left-3.5 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground/25"}),e.jsx(k,{placeholder:"Pesquisar projetos...",value:d,onChange:t=>j(t.target.value),className:"pl-10 h-10 bg-white/[0.02] border-white/[0.04] rounded-xl focus:border-primary/25 transition-all text-[13px]"})]}),f?e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-3",children:[1,2,3].map(t=>e.jsx("div",{className:"h-[280px] rounded-xl bg-white/[0.02] animate-pulse border border-white/[0.02]"},t))}):m.length===0?e.jsxs("div",{className:"text-center py-20",children:[e.jsx("div",{className:"w-14 h-14 rounded-2xl bg-white/[0.02] flex items-center justify-center mx-auto mb-3",children:e.jsx(A,{className:"w-6 h-6 text-muted-foreground/15"})}),e.jsx("p",{className:"text-muted-foreground/35 text-sm",children:"Nenhum projeto encontrado"})]}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-3",children:m.map((t,r)=>{const o=v(t);return e.jsxs(y.div,{initial:{opacity:0,y:8}
11,animate:{opacity:1,y:0},transition:{duration:.3,delay:r*.04},className:"bg-white/[0.02] border border-white/[0.04] rounded-xl overflow-hidden hover:border-white/[0.08] transition-all duration-300 group flex flex-col",children:[e.jsxs("div",{className:"relative aspect-[16/9] bg-white/[0.01] overflow-hidden",children:[o?e.jsx("img",{src:o,alt:"",className:"w-full h-full object-cover group-hover:scale-[1.03] transition-transform duration-700"}):e.jsx("div",{className:"w-full h-full flex items-center justify-center",children:e.jsx(E,{className:"w-8 h-8 text-muted-foreground/10"})}),e.jsxs("div",{className:"absolute top-3 left-3 flex items-center gap-1.5",children:[e.jsx("span",{className:`text-[10px] px-2.5 py-1 rounded-full font-medium tracking-wide backdrop-blur-md ${t.published?"bg-emerald-500/20 text-emerald-300 ring-1 ring-emerald-500/20":"bg-white/10 text-white/50 ring-1 ring-white/10"}`,children:t.published?"Publicado":"Rascunho"}),t.featured&&e.jsx("span",{className:"flex items-center gap-1 text-[10px] px-2 py-1 rounded-full bg-amber-500/20 text-amber-300 ring-1 ring-amber-500/20 backdrop-blur-md font-medium",children:e.jsx(x,{className:"w-3 h-3 fill-current"})})]})]}),e.jsxs("div",{className:"p-4 flex-1 flex flex-col",children:[e.jsx("span",{className:"text-[10px] font-medium text-primary/60 uppercase tracking-wider mb-1.5",children:t.category}),e.jsx("h3",{className:"text-[14px] font-semibold text-foreground/80 leading-snug line-clamp-2 mb-3 group-hover:text-foreground transition-colors flex-1",children:t.title_pt}),e.jsxs("div",{className:"flex items-center gap-1 pt-2 border-t border-white/[0.04]",children:[e.jsx(s,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-lg hover:bg-amber-500/[0.06]",onClick:()=>w(t.id,t.featured),title:t.featured?"Remover destaque":"Destacar",children:e.jsx(x,{className:`w-3.5 h-3.5 ${t.featured?"fill-amber-400 text-amber-400/80":"text-muted-foreground/30"}`})}),e.jsx(s,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-lg hover:bg-white/[0.05]",onClick:()=>b(t.id,t.published),children:t.published?e.jsx(q,{className:"w-3.5 h-3.5 text-emerald-400/70"}):e.jsx(z,{className:"w-3.5 h-3.5 text-muted-foreground/35"})}),e.jsx(u,{to:`/admin/portfolio/${t.id}`,children:e.jsx(s,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-lg hover:bg-white/[0.05]",children:e.jsx(I,{className:"w-3.5 h-3.5 text-muted-foreground/45"})})}),e.jsx("div",{className:"flex-1"}),e.jsx(s,{variant:"ghost",size:"icon",className:"h-8 w-8 rounded-lg hover:bg-red-500/[0.06] text-muted-foreground/30 hover:text-red-400",onClick:()=>N(t.id),children:e.jsx(C,{className:"w-3.5 h-3.5"})})]})]})]},t.id)})})]})};export{M as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.