import{jsx as e,jsxs as r}from"react/jsx-runtime";import{B as i}from"./button-BvFBRYHq.js";import{B as c}from"./badge-CFi7bqqA.js";import{C as d}from"./content-card-D1vitqdC.js";import{Download as h,Loader2 as p,Trash2 as f,FileArchive as l,Shield as x,Folder as u,Database as N}from"lucide-react";import"@radix-ui/react-slot";import"class-variance-authority";import"./utils-CMbmcP35.js";import"clsx";import"tailwind-merge";import"react";import"./card-Zg0WOx-j.js";function F({backups:s,onDownload:n,onDelete:o,deletingBackupId:a}){const m=t=>{switch(t){case"mysql":return e(N,{className:"h-5 w-5"});case"directory":return e(u,{className:"h-5 w-5"});case"full":return e(x,{className:"h-5 w-5"});default:return e(l,{className:"h-5 w-5"})}};return e(d,{title:"Backup History",children:s.length>0?e("div",{className:"space-y-2 max-h-96 overflow-y-auto",children:s.map(t=>r("div",{className:"flex items-center justify-between p-3 border rounded-lg hover:bg-accent/50 transition-colors",children:[r("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[e("div",{className:"text-muted-foreground",children:m(t.type)}),r("div",{className:"flex-1 min-w-0",children:[e("p",{className:"text-sm font-medium truncate",children:t.filename}),r("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[e(c,{variant:"outline",className:"text-xs",children:t.type}),e("span",{children:t.size}),e("span",{children:new Date(t.created_at).toLocaleString()})]}),t.source_path&&r("p",{className:"text-xs text-muted-foreground truncate",children:["Source: ",t.source_path]})]})]}),r("div",{className:"flex items-center gap-1",children:[e(i,{variant:"ghost",size:"sm",onClick:()=>n(t.filename),title:"Download",children:e(h,{className:"h-4 w-4"})}),e(i,{variant:"ghost",size:"sm",onClick:()=>o(t),disabled:a===t.id,title:"Delete",children:a===t.id?e(p,{className:"h-4 w-4 animate-spin"}):e(f,{className:"h-4 w-4"})})]})]},t.id))}):r("div",{className:"text-center py-8 text-muted-foreground",children:[e(l,{className:"h-12 w-12 mx-auto mb-2 opacity-50"}),e("p",{children:"No backups yet"}),e("p",{className:"text-sm",children:"Create your first backup using the buttons above"})]})})}export{F as BackupList};
