import{u as x,a as u,j as e,H as h,L as j}from"./app-CyJEXGyv.js";import{A as f}from"./app-layout-DbUGBUec.js";import{t as v}from"./index-BtT9Eyya.js";import{C as g,a as b,b as N,c as C,d as S}from"./card-BjOMVxEn.js";import{L as l}from"./label-CPJPVYbz.js";import{I as i}from"./input-De4RhZu7.js";import{B as o}from"./button-COEJSQkW.js";import{T as k}from"./textarea-DvQSk7nC.js";import{A as y}from"./arrow-left-BFpIQw4C.js";import{L}from"./loader-circle-C9PZqms-.js";import{S as T}from"./save-5G4mHmGr.js";import"./utils-D3rN0LeJ.js";import"./sheet-D9YCjyPN.js";import"./index-JbHgsFAK.js";import"./index-BiS8IM9B.js";import"./x-CEXz2EER.js";import"./createLucideIcon-DqnlFWer.js";import"./index-CeYyXWc4.js";import"./index-D448AvbX.js";import"./truck-DSNzHzca.js";import"./package-Ca-wQg6n.js";import"./shopping-bag-kX2qM3ec.js";import"./app-logo-icon-bwP4qd8Q.js";import"./bluetooth-context-DlC5mQaA.js";import"./index-l-_2VD5G.js";import"./sonner-DMUJNVEP.js";const D=[{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:D,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(k,{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(y,{})," Kembali"]})}),e.jsxs(o,{variant:"secondary",type:"submit",disabled:p,children:[p?e.jsx(L,{className:"animate-spin"}):e.jsx(T,{})," Simpan Data"]})]})]})})]})})})]})}export{ae as default};
