import{j as s,L as o,s as h,r as c}from"./vendor-tanstack-BVzzyDEt.js";import{G as m,a3 as t,q as i,O as g,P as j,by as p,B as f,a as b,b as n,bq as v,bz as N,bk as k,bA as d}from"./index-BJkJ93Lr.js";import{B}from"./block-type-logo-ESEG5U5y.js";import{L as C}from"./lazy-markdown-CwRqR_1U.js";import"./vendor-react-Bce9NwRC.js";import"./vendor-radix-CTAic6HB.js";import"./vendor-recharts-Mwm2qLZp.js";import"./vendor-forms-BN3tpxM2.js";import"./vendor-date-2jFo9aCm.js";function S({blockType:e}){return s.jsxs(m,{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(t,{variant:"h4",children:e.name})]}),e.description&&s.jsx("div",{className:"prose max-w-none h-32 overflow-y-scroll text-sm",children:s.jsx(C,{children:e.description})}),s.jsxs("div",{className:"flex justify-end gap-4",children:[s.jsx(i,{variant:"secondary",size:"sm",children:s.jsx(o,{to:"/blocks/catalog/$slug",params:{slug:e.slug},children:"Details"})}),s.jsx(i,{size:"sm",children:s.jsx(o,{to:"/blocks/catalog/$slug/create",params:{slug:e.slug},children:"Create"})})]})]})}const y=({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(t,{variant:"bodySmall",className:"text-muted-foreground",children:[e.length," ",g(e.length,"Block")]}),s.jsx("div",{className:"min-w-40",children:s.jsx(j,{value:a,placeholder:"Search blocks",onChange:l=>r(l.target.value)})})]}),s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:e.map(l=>s.jsx(S,{blockType:l},l.id))})]}),L=()=>s.jsx(m,{className:"p-4",children:s.jsxs(t,{variant:"bodySmall",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:p["integrations-guide"],children:"docs"})," ","for a full list of integrations in the SDK"]})}),z=()=>s.jsx(f,{children:s.jsxs(b,{children:[s.jsx(n,{children:s.jsx(v,{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(z,{}),s.jsx(L,{}),s.jsx(y,{blockTypes:e,search:a,onSearch:r})]});function O(){const[e,a]=_(),{data:r}=h(k({block_types:{name:{like_:e}},offset:0}));return s.jsx(w,{blockTypes:r,search:e,onSearch:a})}function _(){const{blockName:e}=d.useSearch(),a=d.useNavigate(),r=c.useCallback(u=>{a({to:".",search:x=>({...x,blockName:u}),replace:!0})},[a]);return[c.useMemo(()=>e??"",[e]),r]}export{O as component};
//# sourceMappingURL=catalog-DkmQFrqg.js.map
