import{j as s,L as n,s as r}from"./vendor-tanstack-DE4ALVGD.js";import{E as l,t as m,v as c,w as d,x,q as p,I as u,D as j,bu as g,C as h,B as f,g as A,h as b,bv as D}from"./index-CNL5pSma.js";import{D as y}from"./delete-confirmation-dialog-Blb6Fypx.js";import{u as N,A as v,a as E,b as S,c as B,d as C}from"./use-delete-automation-confirmation-dialog-KDrkiks7.js";import{A as L}from"./automations-header-hV7Kt75v.js";import"./vendor-react-HBv6Kpyp.js";import"./vendor-radix-K8EF6rBE.js";import"./vendor-recharts-B3wzJa9e.js";import"./vendor-forms-BvpM0AtX.js";import"./vendor-date-Bck8LDfw.js";import"./work-queue-icon-text-BEuAdpzO.js";import"./index-D4OtcoMT.js";import"./dropdown-menu-D34zumpn.js";import"./use-delete-confirmation-dialog-mtiBAiyE.js";const k=()=>s.jsxs(l,{children:[s.jsx(m,{id:"Bot"}),s.jsx(c,{children:"Create an automation to get started"}),s.jsx(d,{children:"Automations bring reactivity to your data stack and let you configure triggers and actions based on events."}),s.jsxs(x,{children:[s.jsx(n,{to:"/automations/create",children:s.jsxs(p,{children:["Add Automation ",s.jsx(u,{id:"Plus",className:"size-4 ml-2"})]})}),s.jsx(j,{id:"automations-guide"})]})]}),I=()=>{const[e,i]=N(),{data:a}=r(g()),o=t=>i(t);return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex flex-col gap-4",children:[s.jsx(L,{}),a.length===0?s.jsx(k,{}):s.jsxs("div",{className:"flex flex-col gap-4",children:[s.jsxs("p",{className:"text-sm text-muted-foreground",children:[a.length," ",`${a.length===1?"automation":"automations"}`]}),s.jsx("ul",{className:"flex flex-col gap-2",children:a.map(t=>s.jsx("li",{"aria-label":`automation item ${t.name}`,children:s.jsx(T,{automation:t,onDelete:()=>o(t)})},t.id))})]})]}),s.jsx(y,{...e})]})},T=({automation:e,onDelete:i})=>s.jsxs(h,{className:"p-4 pt-5 flex flex-col gap-6",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx($,{automation:e}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(v,{automation:e}),s.jsx(E,{id:e.id,onDelete:i})]})]}),s.jsxs("div",{className:"flex flex-col gap-4",children:[e.description&&s.jsx(S,{automation:e}),s.jsx(B,{automation:e}),s.jsx(C,{automation:e})]})]}),$=({automation:e})=>s.jsx(f,{children:s.jsx(A,{children:s.jsx(b,{className:"text-xl",children:s.jsx(D,{to:"/automations/automation/$id",params:{id:e.id},className:"text-lg",children:e.name})})})}),V=I;export{V as component};
//# sourceMappingURL=index-CyWGOeA5.js.map
