import{j as e,H as a,L as r}from"./app-BQEFzdw6.js";import{A as d}from"./AppLayout-kozc03ce.js";import{P as l}from"./PageHeader-Bj1OQnqr.js";import{B as c}from"./Badge-CiLdjUlo.js";import{F as n}from"./PlusIcon-ElxOOThC.js";import{F as x}from"./EyeIcon-CkYifINe.js";import{F as i}from"./PencilIcon-BWjiauNE.js";import"./useThemeColor-qPCpc713.js";function N({items:t}){return e.jsxs(d,{children:[e.jsx(a,{title:"Inventory Items"}),e.jsx(l,{title:"Inventory Items",subtitle:`${(t.data??t).length} items`,children:e.jsxs(r,{href:route("inventory.items.create"),className:"btn btn-primary flex items-center gap-2",children:[e.jsx(n,{className:"w-4 h-4"})," New Item"]})}),e.jsx("div",{className:"p-4 sm:p-6",children:e.jsx("div",{className:"card overflow-hidden",children:e.jsxs("table",{className:"min-w-full divide-y divide-gray-200",children:[e.jsx("thead",{className:"bg-gray-50",children:e.jsx("tr",{children:["Code","Name","Category","Unit","Stock","Reorder Level","Status","Actions"].map(s=>e.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase",children:s},s))})}),e.jsxs("tbody",{className:"divide-y divide-gray-100",children:[(t.data??t).map(s=>e.jsxs("tr",{className:"hover:bg-gray-50",children:[e.jsx("td",{className:"px-4 py-3 text-sm font-mono text-primary-600",children:s.code}),e.jsx("td",{className:"px-4 py-3 text-sm font-medium",children:s.name}),e.jsx("td",{className:"px-4 py-3 text-sm text-gray-600",children:s.category}),e.jsx("td",{className:"px-4 py-3 text-sm text-gray-600",children:s.unit}),e.jsx("td",{className:`px-4 py-3 text-sm font-semibold ${s.current_stock<=s.reorder_level?"text-red-600":"text-green-700"}`,children:s.current_stock}),e.jsx("td",{className:"px-4 py-3 text-sm text-gray-600",children:s.reorder_level}),e.jsx("td",{className:"px-4 py-3",children:e.jsx(c,{variant:s.is_active?"success":"gray",children:s.is_active?"Active":"Inactive"})}),e.jsx("td",{className:"px-4 py-3",children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx(r,{href:route("inventory.items.show",s.id),className:"text-gray-400 hover:text-primary-600",children:e.jsx(x,{className:"w-4 h-4"})}),e.jsx(r,{href:route("inventory.items.edit",s.id),className:"text-gray-400 hover:text-yellow-600",children:e.jsx(i,{className:"w-4 h-4"})})]})})]},s.id)),(t.data??t).length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:8,className:"px-4 py-8 text-center text-gray-400",children:"No inventory items found."})})]})]})})})]})}export{N as default};
