PageSourceSearch

https://lecollectif.tv/assets/briefs._id-BWZWSWDY.js

js lecollectif.tv collected 2026-09-30 06:38:25 UTC 5,768 bytes, 1 lines download raw bytes

1import{k as _,r as a,s as m,j as e,L as d,l as w,c as S}from"./index-r9cUOzRa.js";import{F as C}from"./Footer-CByVw6dE.js";import{a as L}from"./brief-draft-L97wv-XH.js";import{A}from"./arrow-left-D5RLes6A.js";import{L as B}from"./loader-circle-BJSgGe5S.js";import{L as z}from"./lock-qaT5IVRJ.js";import{C as T}from"./check-BbU_BBHd.js";import{C as U}from"./copy-CQSyUQHf.js";const D={draft:"Draft",submitted:"Submitted",under_review:"Under Review",approved:"Approved",shoot_scheduled:"Shoot Scheduled",assets_delivered:"Assets Delivered",complete:"Complete"};function W(){const{id:i}=_.useParams(),[l,n]=a.useState(!0),[s,f]=a.useState(null),[x,b]=a.useState([]),[g,h]=a.useState(""),[p,u]=a.useState(!1);a.useEffect(()=>{let t=!1;return(async()=>{const{data:o}=await m.from("briefs").select("id, title, campaign_objective, target_audience, key_message, campaign_start, campaign_end, platforms, social_insights, status, created_at, utm_code, property_id").eq("id",i).maybeSingle();if(t)return;if(!o){n(!1);return}f(o);const[{data:v},{data:y}]=await Promise.all([m.from("shot_list_items").select("shot_description, order_index").eq("brief_id",i).order("order_index",{ascending:!0}),m.from("properties").select("property_name").eq("id",o.property_id).maybeSingle()]);t||(b((v??[]).map(N=>N.shot_description).filter(Boolean)),h(y?.property_name??""),n(!1))})(),()=>{t=!0}},[i]);const c=s?.utm_code??(s?`track.lecollectif.tv/?utm_source=lecollectif&utm_medium=social&utm_campaign=${L(g)}&utm_content=${s.id}`:"");async function j(){c&&(await navigator.clipboard.writeText(c),u(!0),setTimeout(()=>u(!1),1500))}const k=s&&s.status!=="draft";return e.jsxs("div",{className:"app-scope flex min-h-screen flex-col bg-background",children:[e.jsx(E,{}),e.jsxs("div",{className:"mx-auto w-full max-w-3xl flex-1 px-6 py-8 lg:px-10",children:[e.jsxs(d,{to:"/briefs",className:"mb-4 inline-flex items-center gap-1.5 text-sm font-medium text-ink-soft hover:text-ink",children:[e.jsx(A,{className:"size-4"})," All briefs"]}),l?e.jsxs("div",{className:"flex items-center gap-2 text-sm text-ink-soft",children:[e.jsx(B,{className:"size-4 animate-spin"})," Loading…"]}):s?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mb-6",children:[e.jsx("div",{className:"text-xs font-semibold uppercase tracking-wide text-ink-soft",children:D[s.status]??s.status}),e.jsx("h1",{className:"mt-1 font-display text-3xl font-black tracking-tight text-ink",children:s.title||"Untitled brief"})]}),k?e.jsxs("div",{className:"mb-6 flex items-center gap-3 rounded-xl border border-border bg-secondary/60 px-4 py-3",children:[e.jsx("div",{className:"flex size-9 items-center justify-center rounded-full bg-muted text-ink-soft",children:e.jsx(z,{className:"size-4"})}),e.jsx("p",{className:"text-sm font-medium text-ink-soft",children:"Brief locked — under review by Le Collectif."})]}):null,e.jsx("div",{className:"rounded-2xl border border-border bg-card p-6 shadow-card",children:e.jsxs("div",{className:"space-y-6",children:[e.jsx(r,{label:"Objective",value:s.campaign_objective??""}),e.jsx(r,{label:"Audience",value:s.target_audience.join(", ")}),e.jsx(r,{label:"Key message",value:s.key_message??"",multiline:!0}),e.jsx(r,{label:"Campaign period",value:s.campaign_start||s.campaign_end?`${s.campaign_start||"?"} → ${s.campaign_end||"?"}`:""}),e.jsx(r,{label:"Platforms",value:s.platforms.join(", ")}),e.jsx(r,{label:"Key insights",value:s.social_insights??"",multiline:!0}),e.jsxs("div",{children:[e.jsx("div",{className:"mb-1.5 text-xs font-semibold uppercase tracking-wide text-ink-soft",children:"Shot list"}),x.length?e.jsx("ol",{className:"list-decimal space-y-1 rounded-lg border border-border bg-background px-8 py-3 text-sm text-ink",children:x.map((t,o)=>e.jsx("li",{children:t},o))}):e.jsx("p",{className:"text-sm italic text-ink-soft/70",children:"No shots listed."})]}),c?e.jsxs("div",{className:"rounded-xl border border-border bg-secondary/40 p-5",children:[e.jsx("div",{className:"mb-2 text-xs font-semibold uppercase tracking-wide text-ink-soft",children:"UTM tracking link"}),e.jsxs("div",{className:"flex items-stretch gap-2",children:[e.jsx("input",{readOnly:!0,value:c,onFocus:t=>t.currentTarget.select(),className:"flex-1 rounded-lg border border-border bg-background px-3 py-2 font-mono text-xs text-ink"}),e.jsxs("button",{type:"button",onClick:j,className:"inline-flex items-center gap-1.5 rounded-lg bg-ink px-3 py-2 text-xs font-semibold text-paper",children:[p?e.jsx(T,{className:"size-3.5"}):e.jsx(U,{className:"size-3.5"}),p?"Copied":"Copy"]})]})]}):null]})})]}):e.jsx("p",{className:"text-sm text-ink-soft",children:"Brief not found."})]}),e.jsx(C,{dark:!0})]})}function r({label:i,value:l,multiline:n}){return e.jsxs("div",{children:[e.jsx("div",{className:"mb-1 text-xs font-semibold uppercase tracking-wide text-ink-soft",children:i}),l?e.jsx("p",{className:S("text-sm text-ink",n&&"whitespace-pre-wrap"),children:l}):e.jsx("p",{className:"text-sm italic text-ink-soft/70",children:"Not provided"})]})}function E(){return e.jsx("header",{className:"sticky top-0 z-[100] border-b border-border/60 bg-background/85 backdrop-blur",children:e.jsxs("div",{className:"mx-auto flex h-16 w-full max-w-[1400px] items-center justify-between px-6 lg:px-10",children:[e.jsx(d,{to:"/",className:"flex items-center gap-2",children:e.jsx("img",{src:w.url,alt:"LeCollectif",className:"h-7 w-auto"})}),e.jsxs("nav",{className:"flex items-center gap-1",children:[e.jsx(d,{to:"/app/dashboard",className:"rounded-lg px-3 py-1.5 text-sm font-medium text-ink-soft hover:bg-secondary hover:text-ink",children:"Dashboard"}),e.jsx(d,{to:"/briefs",className:"rounded-lg px-3 py-1.5 text-sm font-medium text-ink hover:bg-secondary",children:"My Briefs"})]})]})})}export{W as component};

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.