import{j as e}from"./vendor-query-B2UbickB.js";import{d as c}from"./tasks-BQ1c7trT.js";import{S as x}from"./StatusBadge-XQlNFwmH.js";import{P as m}from"./PriorityBadge-DfQY9St9.js";import{S as i,J as r}from"./index-BZu5zewH.js";import{P as p}from"./PageHeader-CR6TpJG_.js";import{e as j,L as u}from"./vendor-react-CXumBFUA.js";import"./vendor-icons-CrrAvF2g.js";function a({label:t,value:s}){return e.jsxs("div",{children:[e.jsx(i,{className:"mb-1",children:t}),e.jsx("div",{className:"text-sm text-text-primary",children:s??"—"})]})}function f({items:t}){return t.length===0?null:e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute left-[7px] top-3 bottom-3 w-px bg-surface-border"}),e.jsx("div",{className:"space-y-0",children:t.map(s=>e.jsxs("div",{className:"relative flex gap-4 py-3",children:[e.jsx("div",{className:"relative z-10 mt-1",children:e.jsx("div",{className:`w-[15px] h-[15px] rounded-full border-2 ${s.category==="system"?"border-accent-muted bg-surface-raised":"border-accent bg-accent"}`})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-baseline gap-3",children:[e.jsx("p",{className:"text-sm text-text-primary",children:s.label}),s.timestamp&&e.jsx("time",{className:"text-[10px] text-text-tertiary font-mono shrink-0",children:new Date(s.timestamp).toLocaleTimeString()})]}),s.detail&&e.jsx("div",{className:"mt-1",children:s.detail})]})]},s.id))})]})}function S(){const{id:t}=j(),{data:s,isLoading:o}=c(t);if(o)return e.jsxs("div",{className:"animate-pulse space-y-4",children:[e.jsx("div",{className:"h-8 bg-surface-sunken rounded w-48"}),e.jsx("div",{className:"h-40 bg-surface-sunken rounded"})]});if(!s)return e.jsx("p",{className:"text-sm text-text-secondary",children:"Task not found."});const n=(s.milestones??[]).map((l,d)=>({id:d,label:l.name,timestamp:l.created_at,detail:e.jsx("span",{className:"text-xs text-text-secondary font-mono",children:typeof l.value=="object"?JSON.stringify(l.value):String(l.value)}),category:"user"}));return e.jsxs("div",{children:[e.jsx(p,{title:"Task Detail"}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-12",children:[e.jsxs("div",{className:"lg:col-span-2 space-y-10",children:[e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-6",children:[e.jsx(a,{label:"Status",value:e.jsx(x,{status:s.status})}),e.jsx(a,{label:"Priority",value:e.jsx(m,{priority:s.priority})}),e.jsx(a,{label:"Workflow Type",value:e.jsx("span",{className:"font-mono text-xs",children:s.workflow_type})}),e.jsx(a,{label:"LT Type",value:e.jsx("span",{className:"font-mono text-xs",children:s.lt_type})}),e.jsx(a,{label:"Task Queue",value:e.jsx("span",{className:"font-mono text-xs",children:s.task_queue})}),e.jsx(a,{label:"Workflow ID",value:e.jsx("span",{className:"font-mono text-xs break-all",children:s.workflow_id})}),e.jsx(a,{label:"Started",value:s.started_at?new Date(s.started_at).toLocaleString():"—"}),e.jsx(a,{label:"Completed",value:s.completed_at?new Date(s.completed_at).toLocaleString():"—"}),e.jsx(a,{label:"Signal ID",value:e.jsx("span",{className:"font-mono text-xs break-all",children:s.signal_id})})]}),s.error&&e.jsxs("div",{children:[e.jsx(i,{className:"mb-2 text-status-error",children:"Error"}),e.jsx("p",{className:"text-sm text-text-primary font-mono",children:s.error})]}),n.length>0&&e.jsxs("div",{children:[e.jsx(i,{className:"mb-4",children:"Milestones"}),e.jsx(f,{items:n})]}),e.jsx(u,{to:`/workflows/executions/${s.workflow_id}`,className:"btn-secondary inline-block text-xs",children:"View Workflow Execution"})]}),e.jsxs("div",{className:"space-y-8",children:[e.jsx(r,{data:s.envelope,label:"Envelope"}),s.metadata&&e.jsx(r,{data:s.metadata,label:"Metadata"}),s.data&&e.jsx(r,{data:s.data,label:"Result Data"})]})]})]})}export{S as TaskDetailPage};
//# sourceMappingURL=TaskDetailPage-buNgjwiz.js.map
