// @bun
import{Check as n,Circle as m,Trash2 as p}from"lucide-react";import{jsx as r,jsxs as t}from"react/jsx-runtime";function u({task:e,onToggle:d,onDelete:a}){let l=e.priority==="URGENT"?"text-red-200 bg-red-500/10 border-red-500/40":e.priority==="HIGH"?"text-amber-200 bg-amber-500/10 border-amber-500/40":e.priority==="LOW"?"text-emerald-200 bg-emerald-500/10 border-emerald-500/40":"text-violet-200 bg-violet-500/10 border-violet-500/40";return t("div",{className:"flex items-start gap-4 rounded-2xl border border-border/70 bg-card/60 p-4 transition hover:border-border",children:[r("button",{type:"button",className:"rounded-full border border-border p-2 text-muted-foreground hover:bg-muted/40","aria-pressed":e.completed,onClick:()=>d?.(e),children:e.completed?r(n,{className:"h-4 w-4 text-emerald-400"}):r(m,{className:"h-4 w-4"})}),t("div",{className:"flex-1 space-y-2",children:[t("div",{className:"flex flex-wrap items-center gap-2",children:[r("p",{className:`font-medium ${e.completed?"text-muted-foreground line-through":"text-foreground"}`,children:e.title}),r("span",{className:`rounded-full border px-2 py-0.5 text-xs ${l}`,children:e.priority.charAt(0)+e.priority.slice(1).toLowerCase()}),e.category?r("span",{className:"rounded-full bg-muted/40 px-2 py-0.5 text-muted-foreground text-xs",children:e.category.name}):null,e.dueDate?t("span",{className:"text-muted-foreground text-xs",children:["Due ",new Date(e.dueDate).toLocaleDateString()]}):null]}),e.description?r("p",{className:"text-muted-foreground text-sm",children:e.description}):null,e.tags.length?r("div",{className:"flex flex-wrap gap-1",children:e.tags.map((o)=>t("span",{className:"rounded-full bg-muted/40 px-2 py-0.5 text-muted-foreground text-xs",children:["#",o]},o))}):null]}),r("button",{type:"button",className:"text-muted-foreground hover:text-destructive","aria-label":`Delete ${e.title}`,onClick:()=>a?.(e),children:r(p,{className:"h-4 w-4"})})]})}export{u as TaskItem};
