import{r as s,G as N,a as T,b as e}from"./app-DTeOhhdM.js";import{D as v,C as a}from"./column.esm-CqBIx_TJ.js";import{F as u,A as C,B as o}from"./AuthenticatedLayout-DNj-hWy1.js";import{I as w}from"./inputtext.esm-DvYkLvTo.js";import{T as F}from"./toast.esm-CLj0hUIX.js";/* empty css              */import"./index.esm-xhUioO7y.js";import"./index.esm-BlFJNgmX.js";import"./index.esm-CVWS0Xy2.js";import"./helper-Gzy5oJm-.js";import"./asyncToGenerator-BfWTt6ZC.js";import"./createLucideIcon-0QtVMxKe.js";import"./defualtLogo-C0dU5cUD.js";function z({auth:d}){const[p,c]=s.useState([]),[A,m]=s.useState([]),[k,M]=s.useState([]),[R,_]=s.useState([]),[B,h]=s.useState([]),x=s.useRef(),[i,b]=s.useState({global:{value:null,matchMode:u.CONTAINS},name:{value:null,matchMode:u.STARTS_WITH}}),[f,j]=s.useState(""),{get:n}=N();s.useEffect(()=>{T.get(route("shipment.view")).then(t=>{c(t.data.req),m(t.data.product)})},[]);const S=t=>{const r=t.target.value;let l={...i};l.global.value=r,b(l),j(r)},g=()=>e.jsxs("div",{className:"w-100% flex justify-between	",children:[e.jsx(o,{type:"button",icon:e.jsx("span",{className:"pi pi-plus text-sm pr-1"}),label:"Add",onClick:()=>{n(route("product-shifting.index"))},className:"p-button-success h-[41px]  text-[14px] "}),e.jsxs("span",{className:"p-input-icon-left h-10 ",children:[e.jsx("i",{className:"pi pi-search"}),e.jsx(w,{className:"h-[41px] w-48",value:f,onChange:S,placeholder:"Search"})]})]}),y=t=>e.jsxs("b",{className:`product-badge  ${t.status==1?"pending":t.status==2?"complite":"new"} `,children:[" ",t.status==1?"pending":t.status==2?"Delivered":"new"]});return e.jsxs(C,{user:d.user,header:e.jsxs(e.Fragment,{children:[e.jsx("h2",{className:"text-skin-header font-medium ",children:"Shipment"})," ",e.jsxs("p",{className:"text-skin-sub-header font-semibold text-xs",children:[" ","Home - Shipment"]})]}),headerButton:e.jsx(e.Fragment,{}),children:[e.jsx(F,{ref:x}),e.jsx("div",{className:"card",children:e.jsxs(v,{className:"defulattable",value:p,paginator:!0,showGridlines:!0,rows:10,dataKey:"id",header:g,filters:i,emptyMessage:"No product found.",children:[e.jsx(a,{field:"reqsition_no",header:"Requisition No"}),e.jsx(a,{field:"shop_id",body:t=>t?t.shop.name:"",header:"Shop",dataType:"boolean"}),e.jsx(a,{field:"warehouse_id",header:"Warehouse",body:t=>t?t.warehouse.name:"",dataType:"boolean"}),e.jsx(a,{field:"status",body:y,header:"status",dataType:"boolean"}),e.jsx(a,{header:"Action",body:t=>e.jsxs(e.Fragment,{children:[" ",t.status<2&&e.jsx(o,{icon:"pi pi-pencil",onClick:()=>{n(route("shipment-product.edit",t.id))},className:"p-button-rounded p-button-success mr-2 px-3 py-2  w-10 h-10 font-medium"}),e.jsx(o,{icon:"pi pi-print",onClick:()=>{h(t),setTimeout(()=>{window.print()},100)},className:"p-button-rounded p-button-info px-3 py-2   w-10 h-10  font-medium"})]}),dataType:"boolean",bodyClassName:"text-center",style:{minWidth:"8rem"}})]})})]})}export{z as default};
