import{j as t}from"./vendor-query-B2UbickB.js";import{c as u}from"./tasks-BQ1c7trT.js";import{u as g}from"./workflows-CD7-d5w8.js";import{u as w}from"./useFilterParams-x-Dg0Vgz.js";import{D as y}from"./DataTable-D9yuBv0w.js";import{S as c}from"./StatusBadge-XQlNFwmH.js";import{P as k}from"./PriorityBadge-DfQY9St9.js";import{T as n}from"./TimeAgo-Dvkw4shy.js";import{S as x}from"./StickyPagination-BWhFSr2d.js";import{F as P,b as p}from"./FilterBar-Ck4K4rzu.js";import{P as b}from"./PageHeader-CR6TpJG_.js";import{W as _}from"./WorkflowPill-54px0YiY.js";import{c as j}from"./vendor-react-CXumBFUA.js";import"./index-BZu5zewH.js";import"./vendor-icons-CrrAvF2g.js";import"./EmptyState-BcsfPq9T.js";const v=[{value:"pending",label:"Pending"},{value:"in_progress",label:"In Progress"},{value:"completed",label:"Completed"},{value:"needs_intervention",label:"Needs Intervention"},{value:"cancelled",label:"Cancelled"}],S=[{key:"status",label:"Status",render:e=>t.jsx(c,{status:e.status}),className:"w-40"},{key:"workflow_type",label:"Workflow Type",render:e=>t.jsx(_,{type:e.workflow_type})},{key:"lt_type",label:"LT Type",render:e=>t.jsx("span",{className:"text-text-secondary text-xs",children:e.lt_type})},{key:"priority",label:"Priority",render:e=>t.jsx(k,{priority:e.priority}),className:"w-20"},{key:"started_at",label:"Started",render:e=>t.jsx(n,{date:e.started_at}),className:"w-28"},{key:"updated_at",label:"Updated",render:e=>t.jsx(n,{date:e.updated_at}),className:"w-28"}];function O(){const e=j(),{filters:r,setFilter:l,pagination:s}=w({filters:{status:"",workflow_type:""}}),{data:m}=g(),d=[...new Set((m??[]).map(a=>a.workflow_type))].sort(),{data:o,isLoading:f}=u({status:r.status||void 0,workflow_type:r.workflow_type||void 0,limit:s.pageSize,offset:s.offset}),i=(o==null?void 0:o.total)??0;return t.jsxs("div",{children:[t.jsx(b,{title:"Tasks"}),t.jsxs(P,{children:[t.jsx(p,{label:"Status",value:r.status,onChange:a=>l("status",a),options:v}),t.jsx(p,{label:"Workflow Type",value:r.workflow_type,onChange:a=>l("workflow_type",a),options:d.map(a=>({value:a,label:a}))})]}),t.jsx(y,{columns:S,data:(o==null?void 0:o.tasks)??[],keyFn:a=>a.id,onRowClick:a=>e(`/workflows/tasks/detail/${a.id}`),isLoading:f,emptyMessage:"No tasks found"}),t.jsx(x,{page:s.page,totalPages:s.totalPages(i),onPageChange:s.setPage,total:i,pageSize:s.pageSize,onPageSizeChange:s.setPageSize})]})}export{O as TasksListPage};
//# sourceMappingURL=TasksListPage-BQjjNjRC.js.map
