import{u as x,r as a,j as e,t as r,s as h}from"./index-C-9v46qO.js";import{B as g}from"./button-B-2orO_-.js";import{I as c}from"./input-Dr7-mDl9.js";import{L as l}from"./label-BXZLGOSD.js";import{C as j}from"./card-Bnq45TwS.js";import"./utils-BQHNewu7.js";function L(){const u=x(),[t,d]=a.useState(""),[n,p]=a.useState(""),[o,i]=a.useState(!1),f=async s=>{if(s.preventDefault(),t.length<8){r.error("পাসওয়ার্ড অন্তত ৮ অক্ষর হতে হবে");return}if(t!==n){r.error("পাসওয়ার্ড মিলছে না");return}i(!0);const{error:m}=await h.auth.updateUser({password:t});if(i(!1),m){r.error(m.message);return}r.success("পাসওয়ার্ড পরিবর্তন সফল"),u({to:"/admin"})};return e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background px-4 py-12",children:e.jsxs(j,{className:"w-full max-w-md p-8",children:[e.jsx("h1",{className:"text-2xl font-semibold text-center mb-6",children:"নতুন পাসওয়ার্ড সেট করুন"}),e.jsxs("form",{onSubmit:f,className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(l,{htmlFor:"pass",children:"নতুন পাসওয়ার্ড"}),e.jsx(c,{id:"pass",type:"password",value:t,onChange:s=>d(s.target.value),required:!0,minLength:8})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(l,{htmlFor:"confirm",children:"পাসওয়ার্ড নিশ্চিত করুন"}),e.jsx(c,{id:"confirm",type:"password",value:n,onChange:s=>p(s.target.value),required:!0,minLength:8})]}),e.jsx(g,{type:"submit",className:"w-full",disabled:o,children:o?"সেভ হচ্ছে...":"পাসওয়ার্ড আপডেট করুন"})]})]})})}export{L as component};
