1import{j as e}from"./vendor-ui-D1UDeh-v.js";import{u as p}from"./vendor-query-CubfWGpY.js";import{C as y,F as h}from"./client-layout-jyMPw3-x.js";import{_ as w,aI as C,e as u}from"./index-BSwJ188z.js";import{a as r,C as i}from"./card-Dkz0sTZx.js";import{B as T}from"./badge-BkFkMDWj.js";import{b as t}from"./skeleton-Ac-8osXG.js";import{j as L,L as g}from"./vendor-react-DeqsDqFx.js";import{T as P,a as k,b as j,c as f}from"./tabs-BZQCG-xv.js";import{P as N}from"./plus-BVi2_X1H.js";import{P as E}from"./play-CGiluw7J.js";import{C as _}from"./calendar-DrU_gFIm.js";import{E as A}from"./external-link-B8Kc3GgO.js";import{f as V}from"./vendor-date-cCTcHgCD.js";import{e as M}from"./es-C_ZIaxFs.js";import"./avatar-DCjzxDsb.js";import"./building-2-BjF1JBNO.js";import"./theme-toggle-YE_R6qAm.js";import"./dropdown-menu-BQTXEdty.js";import"./chevron-right-CffDALGq.js";import"./check-XshoAwZn.js";import"./circle-Sp_oSXiz.js";import"./layout-dashboard-BrBmkV2M.js";import"./file-text-D09bKiUi.js";import"./chart-column-dJbii2Cf.js";import"./settings-Bg1E2PeC.js";import"./log-out-oMBGuT94.js";import"./vendor-pdf-CKHnKPQA.js";import"./vendor-charts-ySIMY-rc.js";import"./vendor-motion-BDEIWYOb.js";const v={pendiente_grabar:{label:"Pendiente grabar",color:"bg-amber-500/10 text-amber-500"},pendiente_editar:{label:"En edición",color:"bg-blue-500/10 text-blue-500"},listo_para_enviar:{label:"Listo para enviar",color:"bg-green-500/10 text-green-500"},enviado:{label:"Entregado",color:"bg-purple-500/10 text-purple-500"}},U={tiktok:"Video TikTok",instagram:"Video Instagram",youtube:"Video YouTube",photo:"Foto Producto",carousel:"Carrusel",reel:"Reel"};function ce(){const{user:s,isLoading:b}=w();if(b)return e.jsx(C,{});if(!s||s.role!=="client"&&s.role!=="admin"&&s.role!=="superadmin")return e.jsx(L,{to:"/admin/login"});const{data:d}=p({queryKey:["/api/client/me"]}),{data:o,isLoading:c}=p({queryKey:["/api/client/projects"]}),l=o?.filter(a=>a.status!=="enviado")||[],n=o?.filter(a=>a.status==="enviado")||[],x=({project:a})=>e.jsx(r,{className:"hover:shadow-md transition-shadow","data-testid":`project-card-${a.id}`,children:e.jsx(i,{className:"pt-6",children:e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("div",{className:"w-14 h-14 bg-primary/10 rounded-lg flex items-center justify-center flex-shrink-0",children:e.jsx(E,{className:"w-6 h-6 text-primary"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold truncate",children:a.title}),a.contentType&&e.jsx("p",{className:"text-sm text-muted-foreground",children:U[a.contentType]||a.contentType})]}),e.jsx(T,{className:v[a.status]?.color||"bg-secondary",children:v[a.status]?.label||a.status})]}),a.description&&e.jsx("p",{className:"text-sm text-muted-foreground mt-2 line-clamp-2",children:a.description}),e.jsx("div",{className:"flex items-center gap-4 mt-3 text-xs text-muted-foreground",children:e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(_,{className:"w-3 h-3"}),V(new Date(a.createdAt),"d MMM yyyy",{locale:M})]})}),a.status==="enviado"&&a.deliveryUrl&&e.jsxs("a",{href:a.deliveryUrl,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 mt-3 text-sm text-primary hover:underline",children:["Ver contenido ",e.jsx(A,{className:"w-3 h-3"})]})]})]})})},a.id);return e.jsx(y,{title:"Mis Campañas",user:s?{name:s.name||"",email:s.email||"",image:s.avatarUrl||void 0}:void 0,clientName:d?.name||d?.company,actions:e.jsx(g,{href:"/marca/nueva-campana",children:e.jsxs(u,{size:"sm",className:"gap-2","data-testid":"button-new-campaign",children:[e.jsx(N,{className:"w-4 h-4"}),e.jsx("span",{className:"hidden sm:inline",children:"Nueva Campaña"})]})}),children:e.jsxs(P,{defaultValue:"active",className:"space-y-6",children:[e.jsxs(k,{children:[e.jsxs(j,{value:"active","data-testid":"tab-active",children:["En Progreso (",l.length,")"]}),e.jsxs(j,{value:"delivered","data-testid":"tab-delivered",children:["Entregadas (",n.length,")"]})]}),e.jsx(f,{value:"active",children:c?e.jsx("div",{className:"grid gap-4",children:Array.from({length:3}).map((a,m)=>e.jsx(r,{children:e.jsx(i,{className:"pt-6",children:e.jsxs("div",{className:"flex gap-4",children:[e.jsx(t,{className:"w-14 h-14 roun
1ded-lg"}),e.jsxs("div",{className:"flex-1",children:[e.jsx(t,{className:"h-5 w-48 mb-2"}),e.jsx(t,{className:"h-4 w-32 mb-2"}),e.jsx(t,{className:"h-3 w-full"})]})]})})},m))}):l.length>0?e.jsx("div",{className:"grid gap-4",children:l.map(a=>e.jsx(x,{project:a},a.id))}):e.jsx(r,{children:e.jsxs(i,{className:"py-12 text-center",children:[e.jsx(h,{className:"w-12 h-12 mx-auto mb-4 text-muted-foreground opacity-50"}),e.jsx("h3",{className:"font-semibold mb-2",children:"No tienes campañas activas"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Solicita tu primera campaña de contenido UGC"}),e.jsx(g,{href:"/marca/nueva-campana",children:e.jsxs(u,{"data-testid":"button-create-first-campaign",children:[e.jsx(N,{className:"w-4 h-4 mr-2"}),"Nueva Campaña"]})})]})})}),e.jsx(f,{value:"delivered",children:c?e.jsx("div",{className:"grid gap-4",children:Array.from({length:2}).map((a,m)=>e.jsx(r,{children:e.jsx(i,{className:"pt-6",children:e.jsxs("div",{className:"flex gap-4",children:[e.jsx(t,{className:"w-14 h-14 rounded-lg"}),e.jsxs("div",{className:"flex-1",children:[e.jsx(t,{className:"h-5 w-48 mb-2"}),e.jsx(t,{className:"h-4 w-32"})]})]})})},m))}):n.length>0?e.jsx("div",{className:"grid gap-4",children:n.map(a=>e.jsx(x,{project:a},a.id))}):e.jsx(r,{children:e.jsxs(i,{className:"py-12 text-center",children:[e.jsx(h,{className:"w-12 h-12 mx-auto mb-4 text-muted-foreground opacity-50"}),e.jsx("h3",{className:"font-semibold mb-2",children:"Aún no hay entregas"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"El contenido entregado aparecerá aquÃ"})]})})})]})})}export{ce as default}; 2//# sourceMappingURL=campaigns-CEt6gVx2.js.map
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.