import{m as x,j as e,L as j}from"./app-D_lWdAF1.js";import{I as i}from"./input-error-Dz46bbCi.js";import{B as u,A as h}from"./Add-B_lToW0R.js";import{F as n,C}from"./Close-CmjhMxa1.js";import{I as l}from"./input-iieIymNx.js";import{A as b}from"./app-layout-DBWaGSby.js";import{T as f,G as r}from"./Typography-D06EX7-K.js";import{L as g}from"./loader-circle-CqvjZacN.js";import"./app-gFGt7Tbg.js";import"./app-logo-icon-B18IWF-o.js";import"./slots-DhmpWYGS.js";import"./index-DKsctv8k.js";import"./index--DsFJTFe.js";const v=[{title:"Customers",href:"/customers"},{title:"Create",href:"#"}];function J(){const{data:t,setData:a,post:c,processing:o,errors:m,reset:p}=x({name:"",mobile:"",email:""}),d=s=>{s.preventDefault(),c(route("customers.store"),{onFinish:()=>p("password","password_confirmation")})};return e.jsxs(b,{breadcrumbs:v,children:[e.jsx(j,{title:"Create Customer"}),e.jsxs(n,{children:[e.jsx(n.Title,{children:e.jsx(f,{variant:"h6",gutterBottom:!0,children:"Create Customer"})}),e.jsx(n.Body,{children:e.jsx("form",{onSubmit:d,children:e.jsxs(r,{container:!0,spacing:2,children:[e.jsxs(r,{size:12,children:[e.jsx(l,{id:"name",autoFocus:!0,tabIndex:1,autoComplete:"name",value:t.name,onChange:s=>a("name",s.target.value),disabled:o,label:"Customer Name"}),e.jsx(i,{message:m.name,className:"mt-2"})]}),e.jsxs(r,{size:12,children:[e.jsx(l,{label:"Customer Mobile",value:t.mobile,onChange:s=>a("mobile",s.target.value)}),e.jsx(i,{message:m.mobile,className:"mt-2"})]}),e.jsxs(r,{size:12,children:[e.jsx(l,{label:"Customer Email",value:t.email,onChange:s=>a("email",s.target.value)}),e.jsx(i,{message:m.email,className:"mt-2"})]}),e.jsxs(r,{size:12,children:[e.jsxs(u,{type:"submit",startIcon:e.jsx(h,{}),disabled:o,children:[o&&e.jsx(g,{className:"h-4 w-4 animate-spin"}),"Create"]}),e.jsx(u,{style:{marginLeft:"10px"},color:"error",href:route("customers.index"),startIcon:e.jsx(C,{}),children:"Cancel"})]})]})})})]})]})}export{J as default};
