import{r as o,aQ as f,aJ as e}from"./@ui-core-DKdciH1Z.js";import{x as y,bz as l,bL as u,bC as g,y as j,bH as b,k as N,e as v}from"./index-D7KLAbvI.js";import{u as S}from"./update-server-settings-mutation-qr9WBMBs.js";import"./@react-router-DaIuhn3X.js";import"./@reactflow-CJzATMj6.js";import"./@zod-DKyD3xVW.js";import"./@monaco-editor-CSMpaClf.js";function C({settings:t}){const a=o.useId(),n=o.useId(),{toast:r}=y(),i=f(),m=t.body?.display_announcements??!1,p=t.body?.display_updates??!1,{mutate:c,isPending:d}=S({onError:s=>{i.invalidateQueries({queryKey:u()}),g(s)&&r({status:"error",emphasis:"subtle",icon:e.jsx(j,{className:"h-5 w-5 shrink-0 fill-error-700"}),description:s.message,rounded:!0})},onSuccess:()=>{i.invalidateQueries({queryKey:u()}),r({status:"success",emphasis:"subtle",rounded:!0,description:"Settings updated successfully"})}}),x=s=>{c({display_announcements:s})},h=s=>{c({display_updates:s})};return e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"flex items-center gap-5",children:[e.jsx(l,{checked:m,onCheckedChange:x,id:a,disabled:d}),e.jsxs("label",{htmlFor:a,className:"text-text-md",children:[e.jsx("p",{className:"font-semibold",children:"Announcements"}),e.jsx("p",{className:"text-theme-text-secondary",children:"Enable Announcements for important ZenML updates, surveys, and feedback opportunities."})]})]}),e.jsx("hr",{}),e.jsxs("div",{className:"flex items-center gap-5",children:[e.jsx(l,{checked:p,onCheckedChange:h,id:n,disabled:d}),e.jsxs("label",{htmlFor:n,className:"text-text-md",children:[e.jsx("p",{className:"font-semibold",children:"Updates"}),e.jsx("p",{className:"text-theme-text-secondary",children:"Activate Updates to receive the latest ZenML news and feature releases."})]})]})]})}function L(){const{data:t}=b({throwOnError:!0});return e.jsxs(N,{className:"flex flex-col gap-5 p-5",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx("h1",{className:"text-text-xl font-semibold",children:"Notifications"}),e.jsx("p",{className:"text-text-sm text-theme-text-secondary",children:"ZenML comes equipped with default widgets designed to enhance your experience by analyzing usage patterns, gathering your feedback, and ensuring you stay informed about our latest updates and features."})]}),e.jsx("div",{className:"",children:t?e.jsx(C,{settings:t}):e.jsx(v,{className:"h-[250px] w-full"})})]})}export{L as default};
