Meclone / _next /static /chunks /app /inventory /page-b4ece45c666c3009.js
SuriRaja's picture
Deploy static site
31173a3
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[693],{31204:(e,s,a)=>{"use strict";a.r(s),a.d(s,{default:()=>w});var r=a(58081),l=a(82149),i=a(86810),c=a(5160),n=a(80900),t=a(85977),d=a(78666),h=a(89181),x=a(82059),o=a(16228),j=a(25192),m=a(22342),u=a(45904),p=a(43210),g=a(92950),y=a(44770),v=a(59921),N=a(36703);let b=(0,a(51018).A)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]),k=[{id:1,name:"MCB 32A Single Pole",category:"Circuit Breakers",brand:"Schneider",sku:"MCB-32A-SP",hsn:"85362000",warranty:"2 years",unit:"Piece",basePrice:450,salePrice:520,quantity:25,reorderLevel:10,status:"In Stock"},{id:2,name:"LED Panel Light 40W",category:"Lighting",brand:"Philips",sku:"LED-40W-PNL",hsn:"94054090",warranty:"3 years",unit:"Piece",basePrice:1200,salePrice:1450,quantity:8,reorderLevel:15,status:"Low Stock"},{id:3,name:"Copper Cable 2.5mm\xb2",category:"Cables",brand:"Havells",sku:"CU-2.5MM-100M",hsn:"85444900",warranty:"1 year",unit:"Meter",basePrice:85,salePrice:95,quantity:450,reorderLevel:100,status:"In Stock"},{id:4,name:"Modular Switch Socket",category:"Switches",brand:"Legrand",sku:"MOD-SW-SOC",hsn:"85363000",warranty:"2 years",unit:"Piece",basePrice:180,salePrice:220,quantity:2,reorderLevel:20,status:"Critical"},{id:5,name:"Distribution Panel 8-Way",category:"Panels",brand:"L&T",sku:"DP-8WAY-MCB",hsn:"85371000",warranty:"5 years",unit:"Piece",basePrice:2800,salePrice:3200,quantity:0,reorderLevel:5,status:"Out of Stock"}];function w(){let[e,s]=(0,l.useState)(k),[a,w]=(0,l.useState)(""),[f,P]=(0,l.useState)(!1),C=e.filter(e=>e.name.toLowerCase().includes(a.toLowerCase())||e.category.toLowerCase().includes(a.toLowerCase())||e.brand.toLowerCase().includes(a.toLowerCase())||e.sku.toLowerCase().includes(a.toLowerCase())),S=(e,s,a)=>0===s?(0,r.jsx)(t.E,{variant:"destructive",children:"Out of Stock"}):s<=a/2?(0,r.jsx)(t.E,{variant:"destructive",children:"Critical"}):s<=a?(0,r.jsx)(t.E,{variant:"secondary",children:"Low Stock"}):(0,r.jsx)(t.E,{variant:"default",children:"In Stock"});return(0,r.jsxs)(d.sF,{children:[(0,r.jsx)("header",{className:"flex h-16 shrink-0 items-center gap-2 transition-[width,height] ease-linear group-has-[[data-collapsible=icon]]/sidebar-wrapper:h-12",children:(0,r.jsxs)("div",{className:"flex items-center gap-2 px-4",children:[(0,r.jsx)(d.x2,{className:"-ml-1"}),(0,r.jsx)(h.w,{orientation:"vertical",className:"mr-2 h-4"}),(0,r.jsx)(x.Qp,{children:(0,r.jsxs)(x.AB,{children:[(0,r.jsx)(x.J5,{children:(0,r.jsx)(x.w1,{href:"/",children:"Dashboard"})}),(0,r.jsx)(x.tH,{}),(0,r.jsx)(x.J5,{children:(0,r.jsx)(x.tJ,{children:"Inventory"})})]})})]})}),(0,r.jsxs)("div",{className:"flex flex-1 flex-col gap-4 p-4 pt-0",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h1",{className:"text-2xl font-bold",children:"Inventory Management"}),(0,r.jsx)("p",{className:"text-muted-foreground",children:"Manage your product inventory and stock levels"})]}),(0,r.jsx)("div",{className:"flex gap-2",children:(0,r.jsxs)(j.lG,{open:f,onOpenChange:P,children:[(0,r.jsx)(j.zM,{asChild:!0,children:(0,r.jsxs)(c.$,{children:[(0,r.jsx)(p.A,{className:"mr-2 h-4 w-4"}),"Add Product"]})}),(0,r.jsxs)(j.Cf,{className:"sm:max-w-[425px]",children:[(0,r.jsxs)(j.c7,{children:[(0,r.jsx)(j.L3,{children:"Add New Product"}),(0,r.jsx)(j.rr,{children:"Enter the details for the new product."})]}),(0,r.jsxs)("div",{className:"grid gap-4 py-4",children:[(0,r.jsxs)("div",{className:"grid grid-cols-4 items-center gap-4",children:[(0,r.jsx)(m.J,{htmlFor:"name",className:"text-right",children:"Name"}),(0,r.jsx)(n.p,{id:"name",className:"col-span-3"})]}),(0,r.jsxs)("div",{className:"grid grid-cols-4 items-center gap-4",children:[(0,r.jsx)(m.J,{htmlFor:"category",className:"text-right",children:"Category"}),(0,r.jsxs)(u.l6,{children:[(0,r.jsx)(u.bq,{className:"col-span-3",children:(0,r.jsx)(u.yv,{placeholder:"Select category"})}),(0,r.jsxs)(u.gC,{children:[(0,r.jsx)(u.eb,{value:"circuit-breakers",children:"Circuit Breakers"}),(0,r.jsx)(u.eb,{value:"lighting",children:"Lighting"}),(0,r.jsx)(u.eb,{value:"cables",children:"Cables"}),(0,r.jsx)(u.eb,{value:"switches",children:"Switches"}),(0,r.jsx)(u.eb,{value:"panels",children:"Panels"})]})]})]}),(0,r.jsxs)("div",{className:"grid grid-cols-4 items-center gap-4",children:[(0,r.jsx)(m.J,{htmlFor:"brand",className:"text-right",children:"Brand"}),(0,r.jsx)(n.p,{id:"brand",className:"col-span-3"})]}),(0,r.jsxs)("div",{className:"grid grid-cols-4 items-center gap-4",children:[(0,r.jsx)(m.J,{htmlFor:"sku",className:"text-right",children:"SKU"}),(0,r.jsx)(n.p,{id:"sku",className:"col-span-3"})]}),(0,r.jsxs)("div",{className:"grid grid-cols-4 items-center gap-4",children:[(0,r.jsx)(m.J,{htmlFor:"quantity",className:"text-right",children:"Quantity"}),(0,r.jsx)(n.p,{id:"quantity",type:"number",className:"col-span-3"})]}),(0,r.jsxs)("div",{className:"grid grid-cols-4 items-center gap-4",children:[(0,r.jsx)(m.J,{htmlFor:"price",className:"text-right",children:"Sale Price"}),(0,r.jsx)(n.p,{id:"price",type:"number",className:"col-span-3"})]})]}),(0,r.jsx)(j.Es,{children:(0,r.jsx)(c.$,{type:"submit",onClick:()=>P(!1),children:"Add Product"})})]})]})})]}),(0,r.jsx)(i.Zp,{children:(0,r.jsx)(i.Wu,{className:"pt-6",children:(0,r.jsxs)("div",{className:"flex gap-4",children:[(0,r.jsxs)("div",{className:"relative flex-1",children:[(0,r.jsx)(g.A,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),(0,r.jsx)(n.p,{placeholder:"Search products by name, category, brand, or SKU...",value:a,onChange:e=>w(e.target.value),className:"pl-10"})]}),(0,r.jsxs)(u.l6,{children:[(0,r.jsx)(u.bq,{className:"w-[180px]",children:(0,r.jsx)(u.yv,{placeholder:"Filter by status"})}),(0,r.jsxs)(u.gC,{children:[(0,r.jsx)(u.eb,{value:"all",children:"All Products"}),(0,r.jsx)(u.eb,{value:"in-stock",children:"In Stock"}),(0,r.jsx)(u.eb,{value:"low-stock",children:"Low Stock"}),(0,r.jsx)(u.eb,{value:"out-of-stock",children:"Out of Stock"})]})]})]})})}),(0,r.jsxs)(i.Zp,{children:[(0,r.jsxs)(i.aR,{children:[(0,r.jsxs)(i.ZB,{children:["Products (",C.length,")"]}),(0,r.jsx)(i.BT,{children:"Manage your inventory items and stock levels"})]}),(0,r.jsx)(i.Wu,{children:(0,r.jsx)("div",{className:"overflow-x-auto",children:(0,r.jsxs)(o.XI,{children:[(0,r.jsx)(o.A0,{children:(0,r.jsxs)(o.Hj,{children:[(0,r.jsx)(o.nd,{children:"Product"}),(0,r.jsx)(o.nd,{children:"SKU"}),(0,r.jsx)(o.nd,{children:"Category"}),(0,r.jsx)(o.nd,{children:"Brand"}),(0,r.jsx)(o.nd,{children:"Quantity"}),(0,r.jsx)(o.nd,{children:"Price"}),(0,r.jsx)(o.nd,{children:"Status"}),(0,r.jsx)(o.nd,{children:"Actions"})]})}),(0,r.jsx)(o.BF,{children:C.map(e=>(0,r.jsxs)(o.Hj,{children:[(0,r.jsx)(o.nA,{children:(0,r.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,r.jsx)("div",{className:"flex h-8 w-8 items-center justify-center rounded-lg bg-primary/10",children:(0,r.jsx)(y.A,{className:"h-4 w-4"})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"font-medium",children:e.name}),(0,r.jsxs)("p",{className:"text-sm text-muted-foreground",children:["HSN: ",e.hsn]})]})]})}),(0,r.jsx)(o.nA,{className:"font-mono text-sm",children:e.sku}),(0,r.jsx)(o.nA,{children:e.category}),(0,r.jsx)(o.nA,{children:e.brand}),(0,r.jsx)(o.nA,{children:(0,r.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,r.jsxs)("span",{children:[e.quantity," ",e.unit]}),e.quantity<=e.reorderLevel&&(0,r.jsx)(v.A,{className:"h-4 w-4 text-orange-500"})]})}),(0,r.jsxs)(o.nA,{children:["₹",e.salePrice]}),(0,r.jsx)(o.nA,{children:S(e.status,e.quantity,e.reorderLevel)}),(0,r.jsx)(o.nA,{children:(0,r.jsxs)("div",{className:"flex space-x-2",children:[(0,r.jsx)(c.$,{variant:"outline",size:"sm",children:(0,r.jsx)(N.A,{className:"h-4 w-4"})}),(0,r.jsx)(c.$,{variant:"outline",size:"sm",children:(0,r.jsx)(b,{className:"h-4 w-4"})})]})})]},e.id))})]})})})]})]})]})}},44770:(e,s,a)=>{"use strict";a.d(s,{A:()=>r});let r=(0,a(51018).A)("Package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["path",{d:"m3.3 7 7.703 4.734a2 2 0 0 0 1.994 0L20.7 7",key:"yx3hmr"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]])},53766:(e,s,a)=>{Promise.resolve().then(a.bind(a,31204))}},e=>{var s=s=>e(e.s=s);e.O(0,[484,197,666,802,497,954,358],()=>s(53766)),_N_E=e.O()}]);