import{BookCopy as Q,Plus as V,RefreshCcw as X}from"lucide-react";import{jsx as b,jsxs as g}from"react/jsx-runtime";function Z({sources:z,onRefresh:F,onDelete:J,onAdd:M}){return g("div",{className:"space-y-4 rounded-2xl border border-border bg-card p-4",children:[g("header",{className:"flex flex-wrap items-center justify-between gap-3",children:[g("div",{children:[b("p",{className:"font-semibold text-sm uppercase tracking-wide",children:"Knowledge sources"}),b("p",{className:"text-muted-foreground text-sm",children:"Manage documentation, specs, and repos powering Studio RAG flows."})]}),g("button",{type:"button",className:"btn-primary inline-flex items-center gap-2",onClick:M,children:[b(V,{className:"h-4 w-4"}),"Add source"]})]}),b("div",{className:"space-y-3",children:z.length?z.map((q)=>g("div",{className:"flex flex-wrap items-center justify-between gap-3 rounded-xl border border-border bg-background p-4",children:[g("div",{className:"flex items-center gap-3",children:[b(Q,{className:"h-8 w-8 text-muted-foreground"}),g("div",{children:[b("p",{className:"font-semibold text-base",children:q.name}),b("p",{className:"text-muted-foreground text-sm",children:q.type}),b("p",{className:"text-muted-foreground text-xs",children:q.indexed?`Indexed ${q.lastIndexed?new Date(q.lastIndexed).toLocaleString():""}`:"Pending indexing"})]})]}),g("div",{className:"flex items-center gap-2",children:[g("button",{type:"button",className:"btn-ghost inline-flex items-center gap-1 text-sm",onClick:()=>F?.(q.id),children:[b(X,{className:"h-3.5 w-3.5"}),"Reindex"]}),b("button",{type:"button",className:"btn-ghost text-destructive text-sm",onClick:()=>J?.(q.id),children:"Remove"})]})]},q.id)):b("div",{className:"rounded-xl border border-border border-dashed p-6 text-center text-muted-foreground text-sm",children:"No knowledge sources added yet."})})]})}export{Z as KnowledgeSourceList};
