import{r as w,G as g,j as s}from"./app-Dqm4owHT.js";import{I as n}from"./InputError-C6yxhkrz.js";import{I as d}from"./InputLabel-DXC5AKlz.js";import{P as _}from"./PrimaryButton-BHIa8OWS.js";import{T as p}from"./TextInput-CNLOPZiu.js";import{z as y}from"./transition-66IJMx-8.js";function S({className:f=""}){const c=w.useRef(null),i=w.useRef(null),{data:a,setData:e,errors:o,put:x,reset:t,processing:j,recentlySuccessful:h}=g({current_password:"",password:"",password_confirmation:""}),v=r=>{r.preventDefault(),x(route("password.update"),{preserveScroll:!0,onSuccess:()=>t(),onError:l=>{var m,u;l.password&&(t("password","password_confirmation"),(m=c.current)==null||m.focus()),l.current_password&&(t("current_password"),(u=i.current)==null||u.focus())}})};return s.jsxs("section",{className:f,children:[s.jsxs("header",{children:[s.jsx("h2",{className:"text-lg font-medium text-gray-900",children:"Update Password"}),s.jsx("p",{className:"mt-1 text-sm text-gray-600",children:"Gunakaan password dengan kombinasi angka dan huruf minimal 8 karakter"})]}),s.jsxs("form",{onSubmit:v,className:"mt-6 space-y-6",children:[s.jsxs("div",{children:[s.jsx(d,{htmlFor:"current_password",value:"Password Lama"}),s.jsx(p,{id:"current_password",ref:i,value:a.current_password,onChange:r=>e("current_password",r.target.value),type:"password",className:"mt-1 block w-full",autoComplete:"current-password"}),s.jsx(n,{message:o.current_password,className:"mt-2"})]}),s.jsxs("div",{children:[s.jsx(d,{htmlFor:"password",value:"Password Baru"}),s.jsx(p,{id:"password",ref:c,value:a.password,onChange:r=>e("password",r.target.value),type:"password",className:"mt-1 block w-full",autoComplete:"new-password"}),s.jsx(n,{message:o.password,className:"mt-2"})]}),s.jsxs("div",{children:[s.jsx(d,{htmlFor:"password_confirmation",value:"Konfirmasi Password Baru"}),s.jsx(p,{id:"password_confirmation",value:a.password_confirmation,onChange:r=>e("password_confirmation",r.target.value),type:"password",className:"mt-1 block w-full",autoComplete:"new-password"}),s.jsx(n,{message:o.password_confirmation,className:"mt-2"})]}),s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx(_,{disabled:j,children:"Save"}),s.jsx(y,{show:h,enter:"transition ease-in-out",enterFrom:"opacity-0",leave:"transition ease-in-out",leaveTo:"opacity-0",children:s.jsx("p",{className:"text-sm text-gray-600",children:"Saved."})})]})]})]})}export{S as default};
Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]