import{_ as d}from"./Input.7105798b.js";import{bE as m,bF as _,aL as h,c as f,a as n,b,ba as g,ah as v,bD as x,o as y}from"./entry.816e6e91.js";import{u as C}from"./useToast.95f42666.js";const E={class:"p-3"},V={class:"bg-white p-2"},R={__name:"[id]",setup(k){const l=m(),c=_(),i=C(),s=h(""),r=async()=>{var t,o,p,u;const{data:e,pending:a}=await x({url:`shippingCompanies/update/${c.params.id}`,method:"post"},{body:{shipping_cost:s.value,_method:"put"}});((t=e==null?void 0:e.value)==null?void 0:t.status)==1?(s.value="",l.push("/admin/shipping"),i.add({title:(o=e==null?void 0:e.value)==null?void 0:o.message})):((p=e==null?void 0:e.value)==null?void 0:p.status)===0&&i.add({title:(u=e==null?void 0:e.value)==null?void 0:u.message,color:"red"})};return(e,a)=>{const t=d;return y(),f("section",E,[n("div",V,[b(t,{class:"mt-4",modelValue:g(s),"onUpdate:modelValue":a[0]||(a[0]=o=>v(s)?s.value=o:null),label:"Shipping Cost *",placeholder:"Shipping Cost"},null,8,["modelValue"]),n("div",{class:"flex justify-end my-4"},[n("button",{onClick:r,class:"bg-[#FE564E] py-2 px-2 rounded-md text-white"}," Edit ")])])])}}};export{R as default};
