import{a as p,j as a,H as c,L as x}from"./app-CyJEXGyv.js";import{A as h}from"./app-layout-DbUGBUec.js";import{t as g}from"./index-BtT9Eyya.js";import{C as u,a as j,b as f,c as v,d as b}from"./card-BjOMVxEn.js";import{L as n}from"./label-CPJPVYbz.js";import{I as l}from"./input-De4RhZu7.js";import{B as m}from"./button-COEJSQkW.js";import{T as C}from"./textarea-DvQSk7nC.js";import{A as N}from"./arrow-left-BFpIQw4C.js";import{L as P}from"./loader-circle-C9PZqms-.js";import{S as k}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 L=[{title:"Pelanggan",href:route("apps.customers.index")},{title:"Tambah Pelanggan",href:"#"}];function Z(){const{data:s,setData:r,errors:t,processing:i,post:o}=p({name:"",email:"",phone:"",address:"",is_admin:!0}),d=e=>{e.preventDefault(),o(route("apps.customers.store"),{onSuccess:()=>{g("Data has been saved.")}})};return a.jsxs(h,{breadcrumbs:L,children:[a.jsx(c,{title:"Tambah Pelanggan"}),a.jsx("div",{className:"p-4",children:a.jsxs(u,{children:[a.jsxs(j,{children:[a.jsx(f,{children:"Tambah Pelanggan"}),a.jsx(v,{children:"Form ini digunakan untuk menambahkan data pelanggan"})]}),a.jsx(b,{children:a.jsxs("form",{onSubmit:d,children:[a.jsxs("div",{className:"mb-4 flex flex-col gap-2",children:[a.jsxs(n,{children:["Nama Pelanggan ",a.jsx("span",{className:"text-rose-500",children:"*"})]}),a.jsx(l,{type:"text",value:s.name,onChange:e=>r("name",e.target.value),placeholder:"Masukan nama pelanggan"}),a.jsx("p",{className:"text-red-500 text-xs",children:t.name})]}),a.jsxs("div",{className:"mb-4 flex flex-col gap-2",children:[a.jsx(n,{children:"Email Pelanggan"}),a.jsx(l,{type:"email",value:s.email,onChange:e=>r("email",e.target.value),placeholder:"Masukan email pelanggan"}),a.jsx("p",{className:"text-red-500 text-xs",children:t.email})]}),a.jsxs("div",{className:"mb-4 flex flex-col gap-2",children:[a.jsx(n,{children:"Nomor HP Pelanggan"}),a.jsx(l,{type:"number",value:s.phone,onChange:e=>r("phone",e.target.value),placeholder:"Masukan nomor hp pelanggan"}),a.jsx("p",{className:"text-red-500 text-xs",children:t.phone})]}),a.jsxs("div",{className:"mb-4 flex flex-col gap-2",children:[a.jsx(n,{children:"Alamat Pelanggan"}),a.jsx(C,{rows:5,value:s.address,onChange:e=>r("address",e.target.value),placeholder:"Masukan alamat pelanggan"}),a.jsx("p",{className:"text-red-500 text-xs",children:t.address})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(m,{variant:"destructive",asChild:!0,children:a.jsxs(x,{href:route("apps.customers.index"),children:[a.jsx(N,{}),"Kembali"]})}),a.jsxs(m,{variant:"secondary",type:"submit",disabled:i,children:[i?a.jsx(P,{className:"animate-spin"}):a.jsx(k,{})," Simpan Data"]})]})]})})]})})]})}export{Z as default};
