import{j as s,L as l,s as u,r as c}from"./vendor-tanstack-DE4ALVGD.js";import{C as d,q as o,U as h,V as g,bD as j,B as p,g as f,h as i,bv as N,bE as b,bp as v,bF as n}from"./index-CNL5pSma.js";import{B as k}from"./block-type-logo-Ab-MB0rX.js";import{L as B}from"./lazy-markdown-Ds39cUgX.js";import"./vendor-react-HBv6Kpyp.js";import"./vendor-radix-K8EF6rBE.js";import"./vendor-recharts-B3wzJa9e.js";import"./vendor-forms-BvpM0AtX.js";import"./vendor-date-Bck8LDfw.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(k,{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-scroll text-sm",children:s.jsx(B,{children:e.description})}),s.jsxs("div",{className:"flex justify-end gap-4",children:[s.jsx(o,{variant:"secondary",size:"sm",children:s.jsx(l,{to:"/blocks/catalog/$slug",params:{slug:e.slug},children:"Details"})}),s.jsx(o,{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," ",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-blue-600 hover:text-blue-800 visited:text-purple-600",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(i,{children:s.jsx(N,{to:"/blocks",className:"text-xl font-semibold",children:"Blocks"})}),s.jsx(b,{}),s.jsx(i,{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 Q(){const[e,a]=z(),{data:r}=u(v({block_types:{name:{like_:e}},offset:0}));return s.jsx(w,{blockTypes:r,search:e,onSearch:a})}function z(){const{blockName:e}=n.useSearch(),a=n.useNavigate(),r=c.useCallback(m=>{a({to:".",search:x=>({...x,blockName:m}),replace:!0})},[a]);return[c.useMemo(()=>e??"",[e]),r]}export{Q as component};
//# sourceMappingURL=catalog-DseSHswe.js.map
