import{j as e,r as n,s as d}from"./vendor-tanstack-BVzzyDEt.js";import{B as x,a as p,b as c,bq as u,bz as h,G as f,a3 as m,by as j,cZ as N,c_ as b}from"./index-BJkJ93Lr.js";import{u as B,B as g}from"./use-delete-block-document-confirmation-dialog-JH26BNz8.js";import{B as k}from"./block-type-details-CUkO-JbV.js";import{D as y}from"./delete-confirmation-dialog-Baib9xiM.js";import{P as _}from"./python-example-snippet-UamzIB5z.js";import{c as D}from"./vendor-recharts-Mwm2qLZp.js";import"./vendor-react-Bce9NwRC.js";import"./vendor-radix-CTAic6HB.js";import"./vendor-forms-BN3tpxM2.js";import"./vendor-date-2jFo9aCm.js";import"./use-delete-confirmation-dialog-DDTCxOIv.js";import"./block-type-logo-ESEG5U5y.js";import"./lazy-markdown-CwRqR_1U.js";const v=({blockName:s})=>e.jsx(x,{children:e.jsxs(p,{children:[e.jsx(c,{children:e.jsx(u,{to:"/blocks",className:"text-xl font-semibold",children:"Blocks"})}),e.jsx(h,{}),e.jsx(c,{className:"text-xl font-semibold",children:s})]})});function S({data:s,fields:t}){const r=n.useMemo(()=>{let l={};return"properties"in t&&(l=t.properties),Object.keys(l).map(a=>{let o=a;const i=l[a];return i.title&&(o=i.title),{label:o,value:s[a]?JSON.stringify(s[a],null,2):null}})},[s,t]);return e.jsx("dl",{className:"flex flex-col gap-2 p-2 text-xs",children:r.map(({label:l,value:a})=>e.jsxs(n.Fragment,{children:[e.jsx("dt",{className:"text-gray-500 text-sm",children:l}),e.jsx("dd",{className:D("text-base",!a&&"text-gray-500 "),children:a??"None"})]},l))})}const C=({blockDocument:s})=>{const[t,r]=B(),l=()=>r(s,{shouldNavigate:!0}),{block_type:a}=s,o=s.name??s.block_type_name??"Block Document";return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(v,{blockName:o}),e.jsx(g,{blockDocument:s,onDelete:l})]}),e.jsx(f,{className:"p-4",children:e.jsxs("div",{className:"grid grid-cols-[minmax(0,_1fr)_250px] gap-4 ",children:[e.jsxs("div",{className:"flex flex-col gap-4",children:[(a?.code_example||a?.documentation_url)&&e.jsx(P,{hasCodeExample:!!a?.code_example,hasDocumentationUrl:!!a?.documentation_url}),a?.code_example&&e.jsx(_,{codeExample:a.code_example,name:s.name}),s.data&&s.block_schema?.fields&&e.jsx(S,{data:s.data,fields:s.block_schema?.fields})]}),a&&e.jsx(k,{blockType:a})]})})]}),e.jsx(y,{...t})]})};function P({hasCodeExample:s,hasDocumentationUrl:t}){return e.jsxs("div",{className:"flex items-center gap-1",children:[s&&e.jsxs(m,{variant:"bodySmall",className:"muted",children:["Paste this snippet"," ",e.jsx("span",{className:"font-semibold",children:"into your flows"})," to use this block."]}),t&&e.jsxs(m,{variant:"bodySmall",className:"muted",children:["Need help?"," ",e.jsx("a",{className:"underline text-blue-600 hover:text-blue-800 visited:text-purple-600",href:j["blocks-guide"],children:"View Docs"})]})]})}function z(){const{id:s}=N.useParams(),{data:t}=d(b(s));return e.jsx(C,{blockDocument:t})}export{z as component};
//# sourceMappingURL=block._id-BqZDTt9i.js.map
