PageSourceSearch

https://smartedu.ai/build/assets/Index-CBJDBWmJ.js

js smartedu.ai collected 2026-10-05 15:07:05 UTC 5,995 bytes, 1 lines download raw bytes

1import{i as g,t as b}from"./react-C6JdJxIB.js";import{a as c,o as f}from"./index.esm-DxXUb9DD.js";import{t as j}from"./jsx-runtime-CGXBp6bb.js";import"./trans-PZ_OsZUf.js";import{t as v}from"./CentralLayout-B7lm4y_K.js";var w=g(b(),1),e=j();function m({title:t,children:n}){return(0,e.jsxs)("div",{className:"rounded-[28px] border border-slate-200/80 bg-white p-6 shadow-sm",children:[(0,e.jsx)("h3",{className:"mb-6 text-lg font-semibold text-slate-950",children:t}),n]})}function d({label:t,type:n="text",value:i,onChange:o,placeholder:r,error:a}){return(0,e.jsxs)("div",{className:"mb-5",children:[(0,e.jsx)("label",{className:"mb-2 block text-sm font-semibold text-slate-700",children:t}),(0,e.jsx)("input",{type:n,value:i,onChange:o,placeholder:r,className:`w-full rounded-2xl px-4 py-3 text-sm text-slate-800 shadow-sm transition-colors ${a?"border-rose-400 ring-2 ring-rose-50 bg-rose-50/5":"border border-slate-200 bg-white focus:border-indigo-400 focus:outline-none focus:ring-2 focus:ring-indigo-100"}`}),a&&(0,e.jsx)("p",{className:"mt-2 text-sm text-rose-600",children:a})]})}function u({children:t,disabled:n,loading:i}){return(0,e.jsx)("button",{type:"submit",disabled:n||i,className:"rounded-2xl bg-indigo-600 px-6 py-3 text-sm font-semibold text-white shadow-sm shadow-indigo-200 transition hover:bg-indigo-500 disabled:opacity-50",children:i?"Processing...":t})}function C({admin:t}){const{flash:n}=f().props,[i,o]=(0,w.useState)(n?.success||null),r=c({name:t?.name||"",email:t?.email||"",phone:t?.phone||""}),a=c({current_password:"",password:"",password_confirmation:""}),l=c({avatar:null}),x=s=>{s.preventDefault(),r.post(route("admin.settings.updateProfile"),{onSuccess:()=>{o("Profile updated successfully!"),setTimeout(()=>o(null),3e3)}})},p=s=>{s.preventDefault(),a.post(route("admin.settings.updatePassword"),{onSuccess:()=>{o("Password changed successfully!"),a.reset(),setTimeout(()=>o(null),3e3)}})},h=s=>{s.preventDefault(),l.data.avatar&&l.post(route("admin.settings.uploadAvatar"),{onSuccess:()=>{o("Avatar updated successfully!"),l.reset(),setTimeout(()=>o(null),3e3)}})};return(0,e.jsxs)(v,{section:"admin",title:"Admin Settings",currentRoute:"admin.settings.index",children:[i&&(0,e.jsxs)("div",{className:"mb-6 rounded-2xl border border-emerald-200 bg-emerald-50 px-5 py-3 text-sm text-emerald-700",children:["✓ ",i]}),(0,e.jsxs)("div",{className:"mb-8",children:[(0,e.jsx)("h1",{className:"text-3xl font-bold text-slate-950",children:"Settings"}),(0,e.jsx)("p",{className:"mt-2 text-slate-600",children:"Manage your admin account and security preferences"})]}),(0,e.jsxs)("div",{className:"grid gap-6 lg:grid-cols-3",children:[(0,e.jsx)(m,{title:"Profile Picture",children:(0,e.jsxs)("form",{onSubmit:h,className:"space-y-4",children:[(0,e.jsx)("div",{className:"relative mb-4",children:t?.avatar?(0,e.jsx)("img",{src:`${t.avatar}`,alt:t.name,className:"w-full max-w-xs rounded-2xl border-4 border-indigo-100 shadow-md",style:{height:"auto",maxHeight:"300px",objectFit:"contain",objectPosition:"center",display:"block"}}):(0,e.jsx)("div",{className:"flex h-[200px] w-full max-w-xs items-center justify-center rounded-2xl border-4 border-slate-200 bg-gradient-to-br from-slate-100 to-slate-200",children:(0,e.jsx)("span",{className:"text-7xl font-bold text-slate-300",children:t?.name?.charAt(0)?.toUpperCase()})})}),(0,e.jsxs)("div",{className:"rounded-2xl border-2 border-dashed border-slate-300 p-4",children:[(0,e.jsx)("input",{type:"file",accept:"image/*",onChange:s=>l.setData("avatar",s.target.files[0]),className:"block w-full text-sm text-slate-600"}),(0,e.jsx)("p",{className:"mt-2 text-xs text-slate-500",children:"JPG, PNG, GIF up to 2MB"})]}),l.errors.avatar&&(0,e.jsx)("p",{className:"text-sm text-rose-600",children:l.errors.avatar}),(0,e.jsx)(u,{disabled:!l.data.avatar,loading:l.processing,children:"Upload Photo"})]})}),(0,e.jsx)(m,{title:"Profile Information",children:(0,e.jsxs)("form",{onSubmit:x,className:"space-y-5",children:[(0,e.jsx)(d,{label:"Full Name",value:r.data.name,onChange:s=>r.setData("name",s.target.value),placeholder:"Enter your full name",error:r.errors.name}),(0,e.jsx)(d,{label:"Email Address",type:"email",value:r.data.email,onChange:s=>r.setData("email",s.target.value),placeholder:"[email protected]",error:r.errors.email}),(0,e.jsx)(d,{label:"Phone Number",type:"tel",value:r.data.phone,onChange:s=>r.setData("phone",s.target.value),placeholder:"(+1) 555-0000",error:r.errors.phone}),(0,e.jsx)(u,{loading:r.processing,children:"Save Changes"})]})}),(0,e.jsx)(m,{title:"Change Password",children:(0,e.jsxs)("form",{onSubmit:p,className:"space-y-5",children:[(0,e.jsx)(d,{label:"Current Password",type:"password",value:a.data.current_password,onChange:s=>a.setData("current_password",s.target.value),placeholder:"Enter current password",error:a.errors.current_password}),(0,e.jsx)(d,{label:"New Password",type:"password",value:a.data.password,onChange:s=>a.setData("password",s.target.value),placeholder:"At least 8 characters",error:a.errors.password}),(0,e.jsx)(d,{label:"Confirm Password",type:"password",value:a.data.password_confirmation,onChange:s=>a.setData("password_confirmation",s.target.value),placeholder:"Re-enter password",error:a.errors.password_confirmation}),(0,e.jsx)(u,{loading:a.processing,children:"Update Password"})]})})]}),(0,e.jsx)("div",{className:"mt-8 rounded-2xl border border-slate-200 bg-slate-50 p-6",children:(0,e.jsxs)("div",{className:"flex gap-3",children:[(0,e.jsx)("div",{className:"text-2xl",children:"ℹ️"}),(0,e.jsxs)("div",{children:[(0,e.jsx)("h4",{className:"font-semibold text-slate-900",children:"Account Security"}),(0,e.jsxs)("ul",{className:"mt-2 space-y-1 text-sm text-slate-600",children:[(0,e.jsx)("li",{children:"• Keep your password strong and update it regularly"}),(0,e.jsx)("li",{children:"• Use a unique email for admin account recovery"}),(0,e.jsx)("li",{children:"• Profile changes take effect immediately"})]})]})]})})]})}export{C as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.