import{j as s,L as n,s as r}from"./vendor-tanstack-BVzzyDEt.js";import{E as l,m,n as c,o as d,p as x,q as p,I as u,D as j,bp as g,a3 as h,G as f,B as A,a as b,b as y,bq as D}from"./index-BJkJ93Lr.js";import{D as N}from"./delete-confirmation-dialog-Baib9xiM.js";import{u as S,A as v,a as E,b as B,c as C,d as L}from"./use-delete-automation-confirmation-dialog-tkKEViM0.js";import{A as k}from"./automations-header-DhjvYQ5X.js";import"./vendor-react-Bce9NwRC.js";import"./vendor-radix-CTAic6HB.js";import"./vendor-recharts-Mwm2qLZp.js";import"./vendor-forms-BN3tpxM2.js";import"./vendor-date-2jFo9aCm.js";import"./work-queue-icon-text-BMRtr4wA.js";import"./index-HTfhyme4.js";import"./use-delete-confirmation-dialog-DDTCxOIv.js";const I=()=>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"})]})]}),T=()=>{const[e,i]=S(),{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(k,{}),a.length===0?s.jsx(I,{}):s.jsxs("div",{className:"flex flex-col gap-4",children:[s.jsxs(h,{variant:"bodySmall",className:"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($,{automation:t,onDelete:()=>o(t)})},t.id))})]})]}),s.jsx(N,{...e})]})},$=({automation:e,onDelete:i})=>s.jsxs(f,{className:"p-4 pt-5 flex flex-col gap-6",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(q,{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(B,{automation:e}),s.jsx(C,{automation:e}),s.jsx(L,{automation:e})]})]}),q=({automation:e})=>s.jsx(A,{children:s.jsx(b,{children:s.jsx(y,{className:"text-xl",children:s.jsx(D,{to:"/automations/automation/$id",params:{id:e.id},className:"text-lg",children:e.name})})})}),V=T;export{V as component};
//# sourceMappingURL=index-9KK3ROCp.js.map
