import{Button as o}from"@contractspec/lib.design-system";import{PlugZap as g,ToggleRight as p}from"lucide-react";import{jsx as t,jsxs as e}from"react/jsx-runtime";function N({id:n,provider:l,name:c,category:i,enabled:r=!0,lastSyncAt:d,status:a="connected",onToggle:s,onConfigure:m}){return e("div",{className:"flex flex-col gap-4 rounded-2xl border border-border bg-card p-4 shadow-sm",children:[e("header",{className:"flex items-center justify-between",children:[e("div",{children:[t("p",{className:"font-semibold text-xl",children:c}),t("p",{className:"text-muted-foreground text-sm",children:l})]}),e(o,{variant:"outline",size:"sm",className:`inline-flex items-center gap-2 rounded-full border px-3 py-1 font-semibold text-xs uppercase tracking-wide ${a==="connected"?"text-emerald-500 bg-emerald-500/10 border-emerald-500/30":a==="error"?"text-red-500 bg-red-500/10 border-red-500/30":"text-gray-500 bg-gray-500/10 border-gray-500/30"}`,onPress:()=>s?.(n,!r),children:[t(p,{className:"h-3.5 w-3.5"}),r?"Enabled":"Disabled"]})]}),e("div",{className:"text-muted-foreground text-sm",children:[i&&t("span",{className:"font-medium",children:i}),e("div",{className:"mt-2 flex flex-wrap items-center gap-3 text-xs uppercase tracking-wide",children:[e("span",{className:"inline-flex items-center gap-1",children:[t(g,{className:"h-3 w-3"}),a]}),e("span",{children:["Last sync:"," ",d?new Date(d).toLocaleString():"Not synced yet"]})]})]}),e("footer",{className:"flex items-center gap-2",children:[t(o,{className:"flex-1",onPress:()=>m?.(n),children:"Configure"}),t(o,{variant:"ghost",className:"flex-1",onPress:()=>s?.(n,!r),children:r?"Disconnect":"Connect"})]})]})}export{N as IntegrationCard};
