var n=Object.defineProperty;var m=(e)=>e;function p(e,r){this[e]=m.bind(null,r)}var b=(e,r)=>{for(var o in r)n(e,o,{get:r[o],enumerable:!0,configurable:!0,set:p.bind(r,o)})};var s=(e,r)=>()=>(e&&(r=e(e=0)),r);import{Check as i,Circle as u,Trash2 as c}from"lucide-react";import{jsx as t,jsxs as d}from"react/jsx-runtime";function x({task:e,onToggle:r,onDelete:o}){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 d("div",{className:"flex items-start gap-4 rounded-2xl border border-border/70 bg-card/60 p-4 transition hover:border-border",children:[t("button",{type:"button",className:"rounded-full border border-border p-2 text-muted-foreground hover:bg-muted/40","aria-pressed":e.completed,onClick:()=>r?.(e),children:e.completed?t(i,{className:"h-4 w-4 text-emerald-400"}):t(u,{className:"h-4 w-4"})}),d("div",{className:"flex-1 space-y-2",children:[d("div",{className:"flex flex-wrap items-center gap-2",children:[t("p",{className:`font-medium ${e.completed?"text-muted-foreground line-through":"text-foreground"}`,children:e.title}),t("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?t("span",{className:"rounded-full bg-muted/40 px-2 py-0.5 text-muted-foreground text-xs",children:e.category.name}):null,e.dueDate?d("span",{className:"text-muted-foreground text-xs",children:["Due ",new Date(e.dueDate).toLocaleDateString()]}):null]}),e.description?t("p",{className:"text-muted-foreground text-sm",children:e.description}):null,e.tags.length?t("div",{className:"flex flex-wrap gap-1",children:e.tags.map((a)=>d("span",{className:"rounded-full bg-muted/40 px-2 py-0.5 text-muted-foreground text-xs",children:["#",a]},a))}):null]}),t("button",{type:"button",className:"text-muted-foreground hover:text-destructive","aria-label":`Delete ${e.title}`,onClick:()=>o?.(e),children:t(c,{className:"h-4 w-4"})})]})}export{x as TaskItem};
