import{jsxs as i,jsx as r}from"react/jsx-runtime";import{b as m,e as n}from"./table-BrXe3s2z.js";import{B as h}from"./button-BvFBRYHq.js";import{B as u}from"./badge-CFi7bqqA.js";import{d as f,e as p,f as w,c}from"./dropdown-menu-BP80qPHw.js";import{MoreHorizontal as v,Pencil as N,Power as g,Trash2 as x}from"lucide-react";import"./utils-CMbmcP35.js";import"clsx";import"tailwind-merge";import"@radix-ui/react-slot";import"class-variance-authority";import"@radix-ui/react-dropdown-menu";function O({template:e,onEdit:a,onDelete:t,onToggle:d}){const l=(o,s=30)=>o?o.length>s?`${o.substring(0,s)}...`:o:"-";return i(m,{children:[r(n,{className:"font-medium",children:e.name}),r(n,{children:e.item_id}),r(n,{children:e.item_name||"-"}),r(n,{children:e.count}),r(n,{children:r("code",{className:"text-xs bg-muted px-1 py-0.5 rounded font-mono",children:l(e.octet)})}),r(n,{children:r(u,{variant:e.is_active?"default":"secondary",children:e.is_active?"Active":"Inactive"})}),r(n,{className:"text-right",children:i(f,{children:[r(p,{asChild:!0,children:i(h,{variant:"ghost",className:"h-8 w-8 p-0",children:[r("span",{className:"sr-only",children:"Open menu"}),r(v,{className:"h-4 w-4"})]})}),i(w,{align:"end",children:[i(c,{onClick:()=>a(e),children:[r(N,{className:"mr-2 h-4 w-4"}),"Edit"]}),i(c,{onClick:()=>d(e),children:[r(g,{className:"mr-2 h-4 w-4"}),e.is_active?"Deactivate":"Activate"]}),i(c,{onClick:()=>t(e),className:"text-destructive focus:text-destructive",children:[r(x,{className:"mr-2 h-4 w-4"}),"Delete"]})]})]})})]})}export{O as ItemTemplateTableRow};
