import{j as e,L as o,y as r}from"./vendor-tanstack-BpuysabX.js";import{E as l,t as m,v as c,w as d,x,q as p,I as u,D as j,bC as g,U as h,C as f,B as A,g as b,h as D,bD as N}from"./index-CREafGO4.js";import{D as y}from"./delete-confirmation-dialog-DxI68qN2.js";import{u as v,A as S,a as w,b as E,c as C,d as B}from"./use-delete-automation-confirmation-dialog-C5uIRRA8.js";import{A as L}from"./automations-header-48H3dmAW.js";import"./vendor-radix-DIu41Ss_.js";import"./vendor-recharts-C2XeLr4O.js";import"./vendor-forms-Buh7U8Ay.js";import"./vendor-date-C1t37jsh.js";import"./work-queue-icon-text-8VfHurcv.js";import"./index-fMpmRfhu.js";import"./dropdown-menu-DZExFL3b.js";import"./use-delete-confirmation-dialog-BgQibraR.js";const k=()=>e.jsxs(l,{children:[e.jsx(m,{id:"Bot"}),e.jsx(c,{children:"Create an automation to get started"}),e.jsx(d,{children:"Automations bring reactivity to your data stack and let you configure triggers and actions based on events."}),e.jsxs(x,{children:[e.jsx(o,{to:"/automations/create",children:e.jsxs(p,{children:["Add Automation ",e.jsx(u,{id:"Plus",className:"size-4 ml-2"})]})}),e.jsx(j,{id:"automations-guide"})]})]}),I=()=>{const[s,i]=v(),{data:a}=r(g()),n=t=>i(t);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(L,{}),a.length===0?e.jsx(k,{}):e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("p",{className:"text-sm text-muted-foreground",children:[a.length.toLocaleString()," ",h(a.length,"automation")]}),e.jsx("ul",{className:"flex flex-col gap-2",children:a.map(t=>e.jsx("li",{"aria-label":`automation item ${t.name}`,children:e.jsx(T,{automation:t,onDelete:()=>n(t)})},t.id))})]})]}),e.jsx(y,{...s})]})},T=({automation:s,onDelete:i})=>e.jsxs(f,{className:"p-4 pt-5 flex flex-col gap-6",children:[e.jsxs("div",{className:"flex items-center justify-between min-w-0 overflow-hidden",children:[e.jsx(z,{automation:s}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(S,{automation:s}),e.jsx(w,{id:s.id,onDelete:i})]})]}),e.jsxs("div",{className:"flex flex-col gap-4",children:[s.description&&e.jsx(E,{automation:s}),e.jsx(C,{automation:s}),e.jsx(B,{automation:s})]})]}),z=({automation:s})=>e.jsx(A,{className:"min-w-0",children:e.jsx(b,{className:"flex-nowrap min-w-0 overflow-hidden",children:e.jsx(D,{className:"text-xl min-w-0",children:e.jsx(N,{to:"/automations/automation/$id",params:{id:s.id},className:"text-lg truncate block",title:s.name,children:s.name})})})}),V=I;export{V as component};
//# sourceMappingURL=index-BpW4YXx5.js.map
