import{q as x,v as u,j as e,$ as h,Y as j}from"./app-CffHYkHW.js";import{A as f}from"./app-layout-D-VS7nVU.js";import{t as v}from"./index-Dw4sHwMN.js";import{C as g,a as b,b as N,c as C,d as S}from"./card-X_CDEGIm.js";import{L as l}from"./label-iPcRrN_N.js";import{I as i}from"./input-Bw4IOOzt.js";import{B as o}from"./button-qhe8lrPU.js";import{T as y}from"./textarea-BmlqSiZo.js";import{A as k}from"./arrow-left-DFiSAE9E.js";import{L as T}from"./loader-circle-BRrBaJrT.js";import{S as D}from"./save-D2L_UJE7.js";import"./utils-C8zp8JNC.js";import"./sheet-Bisw0FSz.js";import"./index-C0loMkA3.js";import"./index-Cy5bElus.js";import"./index-DPkgfxsD.js";import"./x-BfabuQJD.js";import"./createLucideIcon-DAR-hy5d.js";import"./index-C9NeyPdJ.js";import"./index-CjqRk3xD.js";import"./truck-DnoS8QCL.js";import"./package-BHw0cifz.js";import"./shopping-bag-AryJS2XX.js";import"./app-logo-icon-D3Jzt_fn.js";import"./bluetooth-context-CLrE8g1i.js";import"./sonner-CPUj7IiR.js";const L=[{title:"Supplier",href:route("apps.suppliers.index")},{title:"Tambah Supplier",href:"#"}];function ae(){const{supplierCode:n}=x().props,{data:s,setData:r,errors:t,processing:p,post:m,reset:d}=u({code:n,name:"",email:"",phone:"",address:""}),c=a=>{a.preventDefault(),m(route("apps.suppliers.store"),{onSuccess:()=>{v("Data has been saved."),d()}})};return e.jsxs(f,{breadcrumbs:L,children:[e.jsx(h,{title:"Tambah Supplier"}),e.jsx("div",{className:"p-4",children:e.jsx("form",{onSubmit:c,children:e.jsxs(g,{children:[e.jsxs(b,{children:[e.jsx(N,{children:"Tambah Supplier"}),e.jsx(C,{children:"Form ini digunakan untuk menambahkan data supplier"})]}),e.jsx(S,{className:"p-0",children:e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"mb-4 flex flex-col gap-2",children:[e.jsxs(l,{children:["Kode Supplier",e.jsx("span",{className:"text-rose-500",children:"*"})]}),e.jsx(i,{className:"cursor-not-allowed bg-gray-100 dark:bg-zinc-900 focus:ring-0",readOnly:!0,type:"text",value:s.code,onChange:a=>r("code",a.target.value)}),e.jsx("p",{className:"text-red-500 text-xs",children:t.code})]}),e.jsxs("div",{className:"mb-4 flex flex-col gap-2",children:[e.jsxs(l,{children:["Nama Supplier",e.jsx("span",{className:"text-rose-500",children:"*"})]}),e.jsx(i,{type:"text",value:s.name,onChange:a=>r("name",a.target.value),placeholder:"Masukan nama supplier"}),e.jsx("p",{className:"text-red-500 text-xs",children:t.name})]}),e.jsxs("div",{className:"mb-4 flex flex-col gap-2",children:[e.jsx(l,{children:"Email"}),e.jsx(i,{type:"email",value:s.email,onChange:a=>r("email",a.target.value),placeholder:"Masukan email supplier"}),e.jsx("p",{className:"text-red-500 text-xs",children:t.email})]}),e.jsxs("div",{className:"mb-4 flex flex-col gap-2",children:[e.jsx(l,{children:"Telp"}),e.jsx(i,{type:"number",value:s.phone,onChange:a=>r("phone",a.target.value),placeholder:"Masukan telp supplier"}),e.jsx("p",{className:"text-red-500 text-xs",children:t.phone})]}),e.jsxs("div",{className:"mb-4 flex flex-col gap-2",children:[e.jsx(l,{children:"Alamat"}),e.jsx(y,{rows:5,value:s.address,onChange:a=>r("address",a.target.value),placeholder:"Masukan alamat supplier"}),e.jsx("p",{className:"text-red-500 text-xs",children:t.address})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(o,{variant:"destructive",asChild:!0,children:e.jsxs(j,{href:route("apps.suppliers.index"),children:[e.jsx(k,{})," Kembali"]})}),e.jsxs(o,{variant:"secondary",type:"submit",disabled:p,children:[p?e.jsx(T,{className:"animate-spin"}):e.jsx(D,{})," Simpan Data"]})]})]})})]})})})]})}export{ae as default};
