import{r as j,u as g,j as e,H as b,a as y}from"./app-BeNY_zSm.js";import{A as v}from"./app-layout-DgG7GJrd.js";import{H as N}from"./heading-CT-LucMJ.js";import{C as p,a as x}from"./card-DG7I-_3R.js";import{B as o}from"./button-Dge8PO59.js";import{I as c}from"./input-C0y5Yptz.js";import{L as n}from"./label-GwfI79i1.js";import{T as w}from"./textarea-BlRQb0dx.js";import{d as T}from"./index-6bh5m_Va.js";import{d as C,b as D,T as m,c as l,e as S,a as i}from"./table-b4n8qlVO.js";import{P as I,B as _}from"./index-Bdohy6kp.js";import{T as A}from"./trash-2-CkyRKENG.js";/* empty css            */import"./checkbox-CP6n_Jsi.js";import"./check-ApYQKYPd.js";import"./createLucideIcon-VdTyGa1S.js";import"./minus-DZw6Ijz4.js";import"./app-logo-icon-vDeU-Cqe.js";import"./house-DocrF1YH.js";import"./phone-BwMlHUyB.js";import"./user-cog-CmNZBMeK.js";import"./alert-CxSnbwwr.js";import"./circle-alert-DR8wP1n1.js";import"./circle-check-Cbr55h3A.js";import"./loader-circle-B3vU0DzH.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};a.SENTRY_RELEASE={id:"d90f819d28d132ee9ad7641cbed0d6343dd98ccf"}}catch{}})();try{(function(){var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new a.Error().stack;r&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[r]="4626e63c-ecdf-45ac-9932-28f34887a248",a._sentryDebugIdIdentifier="sentry-dbid-4626e63c-ecdf-45ac-9932-28f34887a248")})()}catch{}function te({useCases:a=[]}){const r=[{title:"Dashboard",href:T().url},{title:"Theme",href:"/admin/theme"},{title:"Use Cases",href:"/admin/theme/use-cases"}],[h,d]=j.useState(!1),t=g({title:"",description:"",icon:"",color:"",order:a.length+1,is_active:!0}),f=s=>{s.preventDefault(),t.post("/admin/theme/use-cases",{onSuccess:()=>{t.reset(),d(!1)}})},u=s=>{confirm("Are you sure you want to delete this use case?")&&y.delete(`/admin/theme/use-cases/${s}`)};return e.jsxs(v,{breadcrumbs:r,children:[e.jsx(b,{title:"Use Cases Section"}),e.jsxs("div",{className:"mx-auto max-w-7xl space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(N,{title:"Use Cases Section",description:"Manage use cases displayed on your site"}),e.jsxs(o,{onClick:()=>d(!h),children:[e.jsx(I,{className:"mr-2 h-4 w-4"}),"Add Use Case"]})]}),h&&e.jsx(p,{children:e.jsx(x,{className:"pt-6",children:e.jsxs("form",{onSubmit:f,className:"space-y-4",children:[e.jsxs("div",{className:"grid gap-4 md:grid-cols-3",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(n,{htmlFor:"title",children:"Title *"}),e.jsx(c,{id:"title",value:t.data.title,onChange:s=>t.setData("title",s.target.value),placeholder:"Sales Teams"}),t.errors.title&&e.jsx("p",{className:"text-sm text-red-600",children:t.errors.title})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(n,{htmlFor:"icon",children:"Icon *"}),e.jsx(c,{id:"icon",value:t.data.icon,onChange:s=>t.setData("icon",s.target.value),placeholder:""})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(n,{htmlFor:"color",children:"Color"}),e.jsx(c,{id:"color",value:t.data.color,onChange:s=>t.setData("color",s.target.value),placeholder:"blue"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(n,{htmlFor:"description",children:"Description *"}),e.jsx(w,{id:"description",value:t.data.description,onChange:s=>t.setData("description",s.target.value),placeholder:"Perfect for sales teams making outbound calls...",rows:3})]}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(o,{type:"button",variant:"outline",onClick:()=>d(!1),children:"Cancel"}),e.jsx(o,{type:"submit",disabled:t.processing,children:t.processing?"Creating...":"Create Use Case"})]})]})})}),e.jsx(p,{children:e.jsx(x,{className:"pt-6",children:e.jsxs(C,{children:[e.jsx(D,{children:e.jsxs(m,{children:[e.jsx(l,{children:"Icon"}),e.jsx(l,{children:"Title"}),e.jsx(l,{children:"Description"}),e.jsx(l,{children:"Status"}),e.jsx(l,{className:"text-right",children:"Actions"})]})}),e.jsx(S,{children:a.length===0?e.jsx(m,{children:e.jsx(i,{colSpan:5,className:"text-center text-muted-foreground",children:'No use cases yet. Click "Add Use Case" to create one.'})}):a.map(s=>e.jsxs(m,{children:[e.jsx(i,{className:"text-2xl",children:s.icon}),e.jsx(i,{className:"font-semibold",children:s.title}),e.jsx(i,{className:"max-w-md truncate",children:s.description}),e.jsx(i,{children:e.jsx(_,{variant:s.is_active?"default":"secondary",children:s.is_active?"Active":"Inactive"})}),e.jsx(i,{className:"text-right",children:e.jsx(o,{variant:"ghost",size:"sm",onClick:()=>u(s.id),children:e.jsx(A,{className:"h-4 w-4"})})})]},s.id))})]})})})]})]})}export{te as default};
//# sourceMappingURL=UseCases-DJ5_tcEM.js.map
