// @bun
import{StatCard as O,StatCardGroup as Y,StatusChip as E}from"@contractspec/lib.design-system";import{Box as M,HStack as I,VStack as Z}from"@contractspec/lib.ui-kit-web/ui/stack";import{cn as _}from"@contractspec/lib.ui-kit-web/ui/utils";import P from"next/link";import{jsx as z,jsxs as F}from"react/jsx-runtime";var $={stable:"success",beta:"warning",experimental:"info",deprecated:"danger"};function V({feature:J,className:Q}){let{meta:D,operations:R,events:U,presentations:W,capabilities:K}=J,X=$[D.stability]??"neutral";return F(Z,{gap:"lg",className:_("w-full",Q),children:[F(I,{gap:"sm",children:[z(E,{tone:X,label:D.stability??"unknown"}),z(E,{tone:"neutral",label:D.key,size:"sm"}),z(E,{tone:"neutral",label:`v${D.version}`,size:"sm"})]}),F(Y,{children:[z(P,{href:`./${J.meta.key}/operations`,children:z(O,{label:"Operations",value:R?.length??0})}),z(P,{href:`./${J.meta.key}/events`,children:z(O,{label:"Events",value:U?.length??0})}),z(P,{href:`./${J.meta.key}/presentations`,children:z(O,{label:"Presentations",value:W?.length??0})})]}),K?.provides?.length?F(M,{className:"flex-col rounded-lg border p-4",gap:"sm",align:"start",children:[z("span",{className:"font-semibold",children:"Provides Capabilities"}),z(I,{gap:"xs",wrap:"wrap",children:K.provides.map((A)=>z(E,{tone:"success",label:`${A.key} v${A.version}`,size:"sm"},`${A.key}-${A.version}`))})]}):null,K?.requires?.length?F(M,{className:"flex-col rounded-lg border p-4",gap:"sm",align:"start",children:[z("span",{className:"font-semibold",children:"Requires Capabilities"}),z(I,{gap:"xs",wrap:"wrap",children:K.requires.map((A)=>z(E,{tone:"info",label:`${A.key}${A.version?` v${A.version}`:""}${A.optional?" (optional)":""}`,size:"sm"},A.key))})]}):null,D.tags?.length?F(M,{className:"flex-col rounded-lg border p-4",gap:"sm",align:"start",children:[z("span",{className:"font-semibold",children:"Tags"}),z(I,{gap:"xs",wrap:"wrap",children:D.tags.map((A)=>z(E,{tone:"neutral",label:`#${A}`,size:"sm"},A))})]}):null,D.owners?.length?F(M,{className:"flex-col rounded-lg border p-4",gap:"sm",align:"start",children:[z("span",{className:"font-semibold",children:"Owners"}),z(I,{gap:"xs",wrap:"wrap",children:D.owners.map((A)=>z(E,{tone:"neutral",label:A,size:"sm"},A))})]}):null]})}export{V as FeatureDetail};
