import{cB as u,cC as f,j as s,cD as p,_ as g,cs as j,ae as N,af as b}from"./vendor-laZsiqLO.js";import{B as t}from"./button-B8f8jW4H.js";import{c as w}from"./utils-RgT4yCq8.js";function S({id:o,category:e,isSubItem:r,onEdit:i,onDelete:n}){const{attributes:c,listeners:m,setNodeRef:l,transform:d,transition:x,isDragging:a}=u({id:o}),h={transform:f.Transform.toString(d),transition:x,zIndex:a?50:"auto",opacity:a?.5:1};return s.jsxs("div",{ref:l,style:h,className:w("flex items-center justify-between p-3 mb-2 bg-card border rounded-md shadow-sm group",r&&"ml-8 border-l-4 border-l-primary/20"),children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("button",{...c,...m,className:"cursor-grab active:cursor-grabbing text-muted-foreground hover:text-foreground",children:s.jsx(p,{className:"h-5 w-5"})}),r?s.jsx(g,{className:"h-4 w-4 text-muted-foreground"}):s.jsx(j,{className:"h-4 w-4 text-primary"}),s.jsx("span",{className:"font-medium",children:e.name})]}),s.jsxs("div",{className:"flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity",children:[s.jsx(t,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>i(e),children:s.jsx(N,{className:"h-4 w-4"})}),s.jsx(t,{variant:"ghost",size:"icon",className:"h-8 w-8 text-destructive",onClick:()=>n(e.id),children:s.jsx(b,{className:"h-4 w-4"})})]})]})}export{S as SortableItem};
