import{v as d,j as a,$ as c,Y as x}from"./app-CffHYkHW.js";import{A as h}from"./app-layout-D-VS7nVU.js";import{t as g}from"./index-Dw4sHwMN.js";import{C as u,a as j,b as f,c as v,d as b}from"./card-X_CDEGIm.js";import{L as n}from"./label-iPcRrN_N.js";import{I as l}from"./input-Bw4IOOzt.js";import{B as m}from"./button-qhe8lrPU.js";import{T as C}from"./textarea-BmlqSiZo.js";import{A as N}from"./arrow-left-DFiSAE9E.js";import{L as P}from"./loader-circle-BRrBaJrT.js";import{S as k}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 y=[{title:"Pelanggan",href:route("apps.customers.index")},{title:"Tambah Pelanggan",href:"#"}];function X(){const{data:s,setData:r,errors:t,processing:i,post:o}=d({name:"",email:"",phone:"",address:"",is_admin:!0}),p=e=>{e.preventDefault(),o(route("apps.customers.store"),{onSuccess:()=>{g("Data has been saved.")}})};return a.jsxs(h,{breadcrumbs:y,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:p,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{X as default};
