PageSourceSearch

https://bowtiesports.com/assets/PostProductionDashboard-DIvFKQk7.js

js bowtiesports.com collected 2026-10-07 02:29:24 UTC 6,398 bytes, 1 lines download raw bytes

1import{r as o,j as e}from"./react-vendor-DUhHROXo.js";import{L as D}from"./router-vendor-Dz9PdDzH.js";import{l as T,_ as F,J as v,o as d,a5 as y,D as L,q,s as A,t as I,aP as k}from"./index-BLtzf0SR.js";import{u as E}from"./useMutation-BXp6BKyU.js";import{s as n}from"./client-DTel1CZI.js";import{A as R}from"./AdminLayout-4AAuHeAU.js";import{C as V}from"./card-9IoFUltb.js";import{B as z}from"./badge-BsE4KYIf.js";import{I as B}from"./input-RFokm5kN.js";import{T as K}from"./textarea-Da4-oaTC.js";import{L as m}from"./label-B2yiss_Q.js";import{S as O,a as Q,b as U,c as M,d as N}from"./select-CMAo_7oa.js";import{s as H}from"./sanitizeStorageUrl-BoqgIL1-.js";import{F as w}from"./film-BsqWNUHV.js";import{P as J}from"./plus-Db1qFqHY.js";import"./NavLink-CsyG-eHO.js";import"./scroll-area-BdyOmc9o.js";import"./index-BdQq_4o_.js";import"./collapsible-BAD8kbtc.js";import"./index-CMI-ZfmW.js";import"./arrow-left-CRb8P6iH.js";import"./globe-CQ83QW2m.js";import"./users-CIwSfVhi.js";import"./activity-CwFToTs3.js";import"./list-todo-BR3jv1RJ.js";import"./calendar-BDETTnfZ.js";import"./users-round-CCw5yxW7.js";import"./radio-BQgeDg5T.js";import"./clapperboard-BvstouST.js";import"./clipboard-list-CQJ-vJ2y.js";import"./image-arBWrt3y.js";import"./folder-open-CIWhCFhy.js";import"./pencil-C2cyk8cg.js";import"./message-square-BDdDilNB.js";import"./ticket-l9bl0kcm.js";import"./megaphone-DpQsxotQ.js";import"./package-DKB1lvtO.js";import"./circle-user-BeB3uaA1.js";import"./folder-kanban-B8jlMC6s.js";import"./settings-Baim_Eei.js";import"./briefcase-CdSp4ViD.js";import"./chart-line-ohAz7u_s.js";import"./index-O12prPmO.js";import"./chevron-up-B89bkR-F.js";const $={draft:{label:"Draft",variant:"outline"},transcribing:{label:"Transcribing",variant:"secondary"},analyzing:{label:"Analyzing",variant:"secondary"},scripting:{label:"Scripting",variant:"secondary"},voicing:{label:"Voicing",variant:"secondary"},rendering:{label:"Rendering",variant:"secondary"},complete:{label:"Complete",variant:"default"},failed:{label:"Failed",variant:"destructive"}};function ze(){const{toast:p}=T(),b=F(),[_,s]=o.useState(!1),[l,u]=o.useState(""),[x,h]=o.useState(""),[j,f]=o.useState("none"),{data:i,isLoading:C}=v({queryKey:["pp-projects"],queryFn:async()=>{const{data:t,error:r}=await n.from("post_production_projects").select("*").order("created_at",{ascending:!1});if(r)throw r;return t}}),{data:a}=v({queryKey:["pp-available-sessions"],queryFn:async()=>{const{data:t,error:r}=await n.from("studio_sessions").select("id, title, recording_url, status, created_at").not("recording_url","is",null).order("created_at",{ascending:!1}).limit(50);if(r)throw r;return t}}),c=E({mutationFn:async()=>{if(!l.trim())throw new Error("Title required");const t=a==null?void 0:a.find(P=>P.id===j),{data:{user:r}}=await n.auth.getUser(),{data:S,error:g}=await n.from("post_production_projects").insert({title:l.trim(),description:x.trim()||null,studio_session_id:(t==null?void 0:t.id)??null,source_audio_url:t!=null&&t.recording_url?H(t.recording_url):null,status:"draft",created_by:(r==null?void 0:r.id)??null}).select().single();if(g)throw g;return S},onSuccess:()=>{p({title:"Project created"}),s(!1),u(""),h(""),f("none"),b.invalidateQueries({queryKey:["pp-projects"]})},onError:t=>p({title:"Failed",description:t.message,variant:"destructive"})});return e.jsx(R,{children:e.jsxs("div",{className:"max-w-6xl mx-auto space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"font-display text-3xl font-bold flex items-center gap-2",children:[e.jsx(w,{className:"h-8 w-8 text-primary"})," Post-Production"]}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Turn raw recordings into finished podcast-style episodes — transcription, AI analysis, voice assets, and render."})]}),e.jsxs(d,{onClick:()=>s(!0),children:[e.jsx(J,{className:"h-4 w-4 mr-2"})," New Project"]})]}),e.jsx(V,{className:"p-0 overflow-hidden",children:C?e.jsx("div",{className:"p-8 flex justify-center text-muted-foreground",children:e.jsx(y,{className:"h-5 w-5 animate-spin"})}):i!=null&&i.length?e.jsx("ul",{className:"divide-y divide-border",children:i.map(t=>{const r=$[t.status];return e.jsx("li",{children:e.jsxs(D,{to:`/admin/post-production/${t.id}`,className:"flex items-center justify-between gap-4 p-4 hover:bg-muted/50 transition-colors",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"font-medium truncate",children:t.title}),t.description&&e.jsx("div",{className:"text-sm text-muted-foreground truncate mt-0.5",children:t.description}),e.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Created ",new Date(t.created_at).toLocaleStr
1ing()]})]}),e.jsx(z,{variant:r.variant,children:r.label})]})},t.id)})}):e.jsxs("div",{className:"p-12 text-center text-muted-foreground",children:[e.jsx(w,{className:"h-10 w-10 mx-auto mb-3 opacity-40"}),e.jsx("p",{className:"font-medium",children:"No post-production projects yet"}),e.jsx("p",{className:"text-sm mt-1",children:"Create one from a finished recording to get started."})]})}),e.jsx(L,{open:_,onOpenChange:s,children:e.jsxs(q,{children:[e.jsx(A,{children:e.jsx(I,{children:"New Post-Production Project"})}),e.jsxs("div",{className:"space-y-4 py-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{htmlFor:"pp-title",children:"Title"}),e.jsx(B,{id:"pp-title",value:l,onChange:t=>u(t.target.value),placeholder:"Episode 12 — Free Agency Recap"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{htmlFor:"pp-desc",children:"Description (optional)"}),e.jsx(K,{id:"pp-desc",value:x,onChange:t=>h(t.target.value),rows:3})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(m,{children:"Source recording (optional)"}),e.jsxs(O,{value:j,onValueChange:f,children:[e.jsx(Q,{children:e.jsx(U,{placeholder:"Pick a finished session"})}),e.jsxs(M,{children:[e.jsx(N,{value:"none",children:"None — I'll add audio later"}),a==null?void 0:a.map(t=>e.jsxs(N,{value:t.id,children:[t.title," (",new Date(t.created_at).toLocaleDateString(),")"]},t.id))]})]})]})]}),e.jsxs(k,{children:[e.jsx(d,{variant:"ghost",onClick:()=>s(!1),children:"Cancel"}),e.jsxs(d,{onClick:()=>c.mutate(),disabled:c.isPending,children:[c.isPending?e.jsx(y,{className:"h-4 w-4 mr-2 animate-spin"}):null,"Create"]})]})]})})]})})}export{ze 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.