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