1import{o as e}from"./chunk-C_JJxWoe.js";import{f as s,g as a,h as t,p as r}from"./chunk-BVoOQtad.js";import{a as n,d as i}from"./chunk-BHIAKbNW.js";import{a as l}from"./chunk-CcfmLqZl.js";import{a as c}from"./chunk-CRKmQqEx.js";import{Bt as o,Gt as d,Lr as m,Ut as x,Vt as h,Wt as u,jr as j,wt as p,zt as f}from"../index-D56I12Dv.js";import{n as g}from"./chunk-QqNSRoPr2.js";import{t as N}from"./chunk-D0zXT10r2.js";var b=e(m(),1),v=j();function _(){const{user:e,signOut:m}=p(),[j,_]=(0,b.useState)([]),[w,y]=(0,b.useState)(!0),[k,S]=(0,b.useState)("");(0,b.useEffect)(()=>{e&&C()},[e]);const C=async()=>{if(!e)return;const{data:s}=await g.from("stakeholders").select("id, name").eq("user_id",e.id).single();if(s){S(s.name||"");const{data:e}=await g.from("content_assets").select("id, content_type, generated_content, created_at, media_urls").eq("stakeholder_id",s.id).order("created_at",{ascending:!1});e&&_(e)}y(!1)},D=e=>{switch(e){case"video_short":case"video_clip":return(0,v.jsx)(c,{className:"h-5 w-5"});case"social_image":case"thumbnail":return(0,v.jsx)(i,{className:"h-5 w-5"});default:return(0,v.jsx)(t,{className:"h-5 w-5"})}};return w?(0,v.jsx)("div",{className:"min-h-screen flex items-center justify-center bg-background",children:(0,v.jsx)("div",{className:"text-muted-foreground",children:"Loading your assets..."})}):(0,v.jsxs)("div",{className:"min-h-screen bg-background",children:[(0,v.jsx)("header",{className:"border-b bg-card",children:(0,v.jsxs)("div",{className:"container mx-auto px-4 py-4 flex items-center justify-between",children:[(0,v.jsxs)("div",{className:"flex items-center gap-3",children:[(0,v.jsx)(s,{className:"h-6 w-6 text-primary"}),(0,v.jsxs)("div",{children:[(0,v.jsx)("h1",{className:"text-xl font-bold text-foreground",children:"Partner Dashboard"}),(0,v.jsx)("p",{className:"text-sm text-muted-foreground",children:k||e?.email})]})]}),(0,v.jsxs)(d,{variant:"ghost",size:"sm",onClick:()=>m(),children:[(0,v.jsx)(r,{className:"h-4 w-4 mr-2"}),"Sign Out"]})]})}),(0,v.jsxs)("main",{className:"container mx-auto px-4 py-8",children:[(0,v.jsxs)("div",{className:"mb-8",children:[(0,v.jsx)("h2",{className:"text-2xl font-bold text-foreground mb-2",children:"Your Assets"}),(0,v.jsx)("p",{className:"text-muted-foreground",children:"Download and share promotional content from your episode appearance."})]}),0===j.length?(0,v.jsx)(f,{children:(0,v.jsxs)(o,{className:"text-center py-12",children:[(0,v.jsx)(s,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),(0,v.jsx)("h3",{className:"text-lg font-semibold text-foreground mb-2",children:"No Assets Yet"}),(0,v.jsx)("p",{className:"text-muted-foreground max-w-md mx-auto",children:"Your promotional assets will appear here once they're ready. We'll send you an email when new content is available."})]})}):(0,v.jsx)("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-6",children:j.map(e=>{return(0,v.jsxs)(f,{className:"hover:border-primary/50 transition-colors",children:[(0,v.jsxs)(x,{className:"pb-3",children:[(0,v.jsxs)("div",{className:"flex items-start justify-between",children:[(0,v.jsxs)("div",{className:"flex items-center gap-2",children:[D(e.content_type),(0,v.jsx)(u,{className:"text-base",children:(s=e.content_type,{video_short:"Video Short",video_clip:"Video Clip",social_image:"Social Image",thumbnail:"Thumbnail",blog_post:"Blog Post",social_post:"Social Post",newsletter:"Newsletter"}[s]||s)})]}),(0,v.jsx)(N,{variant:"secondary",className:"text-xs",children:new Date(e.created_at).toLocaleDateString()})]}),(0,v.jsx)(h,{className:"line-clamp-2",children:e.generated_content?.title||e.generated_content?.caption||"Promotional content"})]}),(0,v.jsxs)(o,{className:"space-y-3",children:[e.media_urls&&(0,v.jsxs)("div",{className:"flex gap-2",children:[(0,v.jsx)(d,{variant:"outline",size:"sm",className:"flex-1",asChild:!0,children:(0,v.jsxs)("a",{href:e.media_urls[0],target:"_blank",rel:"noopener noreferrer",children:[(0,v.jsx)(l,{className:"h-4 w-4 mr-1"}),"Download"]})}),(0,v.jsx)(d,{variant:"ghost",size:"sm",children:(0,v.jsx)(n,{className:"h-4 w-4"})})]}),e.generated_content?.text&&(0,v.jsx)("div",{className:"text-sm text-muted-foreground bg-muted/50 p-3 rounded-md",children:(0,v.jsx)("p",{className:"line-clamp-3",children:e.generated_content.text})})]})]},e.id);var s})}),(0,v.jsxs)("div",{className:"mt-12 border-t pt-8",children:[(0,v.jsx)("h3",{className:"text-lg font-semibold text-foreground mb-4",children:"Qu
1ick Links"}),(0,v.jsxs)("div",{className:"flex flex-wrap gap-4",children:[(0,v.jsx)(d,{variant:"outline",asChild:!0,children:(0,v.jsxs)("a",{href:"/episodes",target:"_blank",rel:"noopener noreferrer",children:[(0,v.jsx)(a,{className:"h-4 w-4 mr-2"}),"View Episodes"]})}),(0,v.jsx)(d,{variant:"outline",asChild:!0,children:(0,v.jsxs)("a",{href:"/research",target:"_blank",rel:"noopener noreferrer",children:[(0,v.jsx)(a,{className:"h-4 w-4 mr-2"}),"Research Library"]})})]})]})]})]})}export{_ 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.