module.exports=[18056,a=>{"use strict";let b=(0,a.i(64831).default)("truck",[["path",{d:"M14 18V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v11a1 1 0 0 0 1 1h2",key:"wrbu53"}],["path",{d:"M15 18H9",key:"1lyqi6"}],["path",{d:"M19 18h2a1 1 0 0 0 1-1v-3.65a1 1 0 0 0-.22-.624l-3.48-4.35A1 1 0 0 0 17.52 8H14",key:"lysw3i"}],["circle",{cx:"17",cy:"18",r:"2",key:"332jqn"}],["circle",{cx:"7",cy:"18",r:"2",key:"19iecd"}]]);a.s(["Truck",0,b],18056)},40252,a=>{"use strict";var b=a.i(87924),c=a.i(72131),d=a.i(18697),e=a.i(18056),f=a.i(6704),g=a.i(50944);a.s(["FulfillOrderForm",0,function({orderId:a,token:h}){let[i,j]=(0,c.useState)(!1),[k,l]=(0,c.useState)("STEADFAST"),m=(0,g.useRouter)(),n=async b=>{b.preventDefault(),j(!0);try{let b=await fetch("/api/shipping",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${h}`},body:JSON.stringify({orderId:a,provider:k,shippingFee:100})});if(!b.ok){let a=await b.json();throw Error(a.message||"Failed to dispatch shipment")}f.default.success("Order dispatched successfully!"),m.refresh()}catch(a){f.default.error(a.message)}finally{j(!1)}};return(0,b.jsxs)("form",{onSubmit:n,className:"flex items-center gap-3",children:[(0,b.jsxs)("select",{value:k,onChange:a=>l(a.target.value),className:"px-3 py-2 border border-slate-200 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-indigo-600 bg-white",children:[(0,b.jsx)("option",{value:"STEADFAST",children:"Steadfast Courier"}),(0,b.jsx)("option",{value:"PATHAO",children:"Pathao Delivery"})]}),(0,b.jsxs)(d.Button,{type:"submit",disabled:i,className:"gap-2 bg-indigo-600 hover:bg-indigo-700 h-9",children:[(0,b.jsx)(e.Truck,{className:"w-4 h-4"}),i?"Dispatching...":"Fulfill Order"]})]})}])}];

//# sourceMappingURL=_085yxd5._.js.map