var Q=Object.defineProperty;var V=(b)=>b;function X(b,q){this[b]=V.bind(null,q)}var k=(b,q)=>{for(var J in q)Q(b,J,{get:q[J],enumerable:!0,configurable:!0,set:X.bind(q,J)})};var m=(b,q)=>()=>(b&&(q=b(b=0)),q);import{BookCopy as Y,Plus as Z,RefreshCcw as $}from"lucide-react";import{jsx as g,jsxs as z}from"react/jsx-runtime";function H({sources:b,onRefresh:q,onDelete:J,onAdd:M}){return z("div",{className:"space-y-4 rounded-2xl border border-border bg-card p-4",children:[z("header",{className:"flex flex-wrap items-center justify-between gap-3",children:[z("div",{children:[g("p",{className:"font-semibold text-sm uppercase tracking-wide",children:"Knowledge sources"}),g("p",{className:"text-muted-foreground text-sm",children:"Manage documentation, specs, and repos powering Studio RAG flows."})]}),z("button",{type:"button",className:"btn-primary inline-flex items-center gap-2",onClick:M,children:[g(Z,{className:"h-4 w-4"}),"Add source"]})]}),g("div",{className:"space-y-3",children:b.length?b.map((F)=>z("div",{className:"flex flex-wrap items-center justify-between gap-3 rounded-xl border border-border bg-background p-4",children:[z("div",{className:"flex items-center gap-3",children:[g(Y,{className:"h-8 w-8 text-muted-foreground"}),z("div",{children:[g("p",{className:"font-semibold text-base",children:F.name}),g("p",{className:"text-muted-foreground text-sm",children:F.type}),g("p",{className:"text-muted-foreground text-xs",children:F.indexed?`Indexed ${F.lastIndexed?new Date(F.lastIndexed).toLocaleString():""}`:"Pending indexing"})]})]}),z("div",{className:"flex items-center gap-2",children:[z("button",{type:"button",className:"btn-ghost inline-flex items-center gap-1 text-sm",onClick:()=>q?.(F.id),children:[g($,{className:"h-3.5 w-3.5"}),"Reindex"]}),g("button",{type:"button",className:"btn-ghost text-destructive text-sm",onClick:()=>J?.(F.id),children:"Remove"})]})]},F.id)):g("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{H as KnowledgeSourceList};
