import{j as e}from"./vendor-react-DrAK5R0M.js";import{Q as c,t as d}from"./index-7eqLqzhB.js";import{p as l,D as m}from"./vendor-icons-Cu2Ube6F.js";function x({variant:o="secondary",className:n=""}){const t=c(),r=async()=>{if(window.confirm("Add CRMy sample data to this workspace? This inserts demo accounts, contacts, opportunities, raw context, Signals, Memory, and Handoffs. Use it only in local, demo, or evaluation workspaces."))try{await t.mutateAsync(!0),d({title:"Sample data added",description:"Demo records are ready. Next: review Signals or open the pending Handoff."})}catch(a){d({title:"Could not add sample data",description:a instanceof Error?a.message:"Check your database connection and try again.",variant:"destructive"})}},s=o==="primary"?"bg-primary text-primary-foreground hover:bg-primary/90":"border border-border text-foreground hover:bg-muted";return e.jsxs("button",{onClick:r,disabled:t.isPending,className:`inline-flex items-center justify-center gap-2 h-9 px-3 rounded-lg text-sm font-semibold transition-colors disabled:opacity-50 ${s} ${n}`,children:[t.isPending?e.jsx(l,{className:"w-4 h-4 animate-spin"}):e.jsx(m,{className:"w-4 h-4"}),t.isPending?"Adding...":"Load sample data"]})}function b({icon:o,title:n,description:t,primary:r,secondary:s,showSampleData:i=!0,iconClassName:a="text-primary"}){return e.jsxs("div",{className:"rounded-xl border border-dashed border-border p-10 text-center",children:[e.jsx("div",{className:"flex justify-center",children:e.jsx(o,{className:`h-10 w-10 ${a||"text-primary"} opacity-70`})}),e.jsx("h2",{className:"mt-3 text-sm font-semibold text-foreground",children:n}),e.jsx("p",{className:"mx-auto mt-1 max-w-md text-sm text-muted-foreground",children:t}),e.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-2 mt-5",children:[r&&e.jsx("button",{onClick:r.onClick,className:"inline-flex items-center justify-center h-9 px-3 rounded-lg bg-primary text-primary-foreground text-sm font-semibold hover:bg-primary/90 transition-colors",children:r.label}),s&&e.jsx("button",{onClick:s.onClick,className:"inline-flex items-center justify-center h-9 px-3 rounded-lg border border-border text-sm font-semibold text-foreground hover:bg-muted transition-colors",children:s.label}),i&&e.jsx(x,{})]})]})}export{b as O,x as S};
