import{j as s,L as l,y as u,r as o}from"./vendor-tanstack-BpuysabX.js";import{C as d,q as c,U as h,V as g,bP as j,B as p,g as f,h as n,bD as k,bQ as N,bw as v,bR as i}from"./index-CREafGO4.js";import{B as b}from"./block-type-logo-BNO1-Opd.js";import{L as B}from"./lazy-markdown-rmxkK4GI.js";import"./vendor-radix-DIu41Ss_.js";import"./vendor-recharts-C2XeLr4O.js";import"./vendor-forms-Buh7U8Ay.js";import"./vendor-date-C1t37jsh.js";function C({blockType:e}){return s.jsxs(d,{className:"p-6",children:[s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx(b,{size:"lg",logoUrl:e.logo_url}),s.jsx("h4",{className:"text-xl font-semibold tracking-tight",children:e.name})]}),e.description&&s.jsx("div",{className:"prose max-w-none h-32 overflow-y-auto text-sm",children:s.jsx(B,{children:e.description})}),s.jsxs("div",{className:"flex justify-end gap-4",children:[s.jsx(c,{variant:"secondary",size:"sm",children:s.jsx(l,{to:"/blocks/catalog/$slug",params:{slug:e.slug},children:"Details"})}),s.jsx(c,{size:"sm",children:s.jsx(l,{to:"/blocks/catalog/$slug/create",params:{slug:e.slug},children:"Create"})})]})]})}const S=({blockTypes:e,search:a,onSearch:r})=>s.jsxs("div",{className:"flex flex-col gap-4",children:[s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsxs("p",{className:"text-sm text-muted-foreground",children:[e.length.toLocaleString()," ",h(e.length,"Block")]}),s.jsx("div",{className:"min-w-40",children:s.jsx(g,{value:a,placeholder:"Search blocks",onChange:t=>r(t.target.value)})})]}),s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:e.map(t=>s.jsx(C,{blockType:t},t.id))})]}),L=()=>s.jsx(d,{className:"p-4",children:s.jsxs("p",{className:"text-sm",children:["Can't find a block for your service? Check out the"," ",s.jsx("a",{className:"underline text-link hover:text-link-hover visited:text-link",href:j["integrations-guide"],children:"docs"})," ","for a full list of integrations in the SDK"]})}),y=()=>s.jsx(p,{children:s.jsxs(f,{children:[s.jsx(n,{children:s.jsx(k,{to:"/blocks",className:"text-xl font-semibold",children:"Blocks"})}),s.jsx(N,{}),s.jsx(n,{className:"text-xl font-semibold",children:"Catalog"})]})}),w=({blockTypes:e,search:a,onSearch:r})=>s.jsxs("div",{className:"flex flex-col gap-6",children:[s.jsx(y,{}),s.jsx(L,{}),s.jsx(S,{blockTypes:e,search:a,onSearch:r})]});function z(){const{blockName:e}=i.useSearch(),a=i.useNavigate(),r=o.useCallback(m=>{a({to:".",search:x=>({...x,blockName:m}),replace:!0})},[a]);return[o.useMemo(()=>e??"",[e]),r]}const K=function(){const[a,r]=z(),{data:t}=u(v({block_types:{name:{like_:a}},offset:0}));return s.jsx(w,{blockTypes:t,search:a,onSearch:r})};export{K as component};
//# sourceMappingURL=catalog-DjoQEIon.js.map
