import{j as e,r as n,s as m}from"./vendor-tanstack-DE4ALVGD.js";import{B as d,g as x,h as c,bv as p,bE as u,C as h,bD as f,dw as j,d8 as N}from"./index-CNL5pSma.js";import{u as B,B as g}from"./use-delete-block-document-confirmation-dialog-CE9u_x9J.js";import{B as b}from"./block-type-details-heMLWolY.js";import{D as k}from"./delete-confirmation-dialog-Blb6Fypx.js";import{P as D}from"./python-example-snippet-BuwltEW_.js";import{c as _}from"./vendor-recharts-B3wzJa9e.js";import"./vendor-react-HBv6Kpyp.js";import"./vendor-radix-K8EF6rBE.js";import"./vendor-forms-BvpM0AtX.js";import"./vendor-date-Bck8LDfw.js";import"./dropdown-menu-D34zumpn.js";import"./use-delete-confirmation-dialog-mtiBAiyE.js";import"./block-type-logo-Ab-MB0rX.js";import"./lazy-markdown-Ds39cUgX.js";const y=({blockName:s})=>e.jsx(d,{children:e.jsxs(x,{children:[e.jsx(c,{children:e.jsx(p,{to:"/blocks",className:"text-xl font-semibold",children:"Blocks"})}),e.jsx(u,{}),e.jsx(c,{className:"text-xl font-semibold",children:s})]})});function v({data:s,fields:a}){const r=n.useMemo(()=>{let l={};return"properties"in a&&(l=a.properties),Object.keys(l).map(t=>{let o=t;const i=l[t];return i.title&&(o=i.title),{label:o,value:s[t]?JSON.stringify(s[t],null,2):null}})},[s,a]);return e.jsx("dl",{className:"flex flex-col gap-2 p-2 text-xs",children:r.map(({label:l,value:t})=>e.jsxs(n.Fragment,{children:[e.jsx("dt",{className:"text-gray-500 text-sm",children:l}),e.jsx("dd",{className:_("text-base",!t&&"text-gray-500 "),children:t??"None"})]},l))})}const C=({blockDocument:s})=>{const[a,r]=B(),l=()=>r(s,{shouldNavigate:!0}),{block_type:t}=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(y,{blockName:o}),e.jsx(g,{blockDocument:s,onDelete:l})]}),e.jsx(h,{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:[(t?.code_example||t?.documentation_url)&&e.jsx(S,{hasCodeExample:!!t?.code_example,hasDocumentationUrl:!!t?.documentation_url}),t?.code_example&&e.jsx(D,{codeExample:t.code_example,name:s.name}),s.data&&s.block_schema?.fields&&e.jsx(v,{data:s.data,fields:s.block_schema?.fields})]}),t&&e.jsx(b,{blockType:t})]})})]}),e.jsx(k,{...a})]})};function S({hasCodeExample:s,hasDocumentationUrl:a}){return e.jsxs("div",{className:"flex items-center gap-1",children:[s&&e.jsxs("p",{className:"text-sm muted",children:["Paste this snippet"," ",e.jsx("span",{className:"font-semibold",children:"into your flows"})," to use this block."]}),a&&e.jsxs("p",{className:"text-sm muted",children:["Need help?"," ",e.jsx("a",{className:"underline text-blue-600 hover:text-blue-800 visited:text-purple-600",href:f["blocks-guide"],children:"View Docs"})]})]})}function J(){const{id:s}=j.useParams(),{data:a}=m(N(s));return e.jsx(C,{blockDocument:a})}export{J as component};
//# sourceMappingURL=block._id-CiwQOgTj.js.map
