veza/apps/web/dist_verification/assets/SettingsPage-C3AsvyKj.js

1 line
9.6 KiB
JavaScript

import{a as g,j as e}from"./vendor-react-BHG7lGYR.js";import{d as s,h as N,t as w,r as v,B as r,C as m,b as h,c as u,v as p,e as j}from"./index-BWcMVITa.js";import{I as b}from"./input-BGBI2Wze.js";import{U as k,aA as y,q as C,j as S,Q as A,p as P,aB as I,aC as z,h as B}from"./vendor-icons-DaGlTw4_.js";import"./vendor-IYr-MHu4.js";import"./vendor-router-D-s5vIeO.js";import"./vendor-tanstack-BzWBL1hV.js";import"./vendor-utils-CgOSfOkx.js";const f=g.forwardRef(({className:t,checked:l,onCheckedChange:i,disabled:o,...n},d)=>{const c=x=>{i&&i(x.target.checked)};return e.jsxs("label",{className:s("peer inline-flex h-[24px] w-[44px] shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors","focus-within:outline-none focus-within:ring-2 focus-within:ring-kodo-cyan focus-within:ring-offset-2 focus-within:ring-offset-kodo-void","disabled:cursor-not-allowed disabled:opacity-50",l?"bg-kodo-cyan":"bg-kodo-steel",t),children:[e.jsx("input",{ref:d,type:"checkbox",className:"sr-only",checked:l,onChange:c,disabled:o,...n}),e.jsx("span",{className:s("pointer-events-none block h-5 w-5 rounded-full bg-white shadow-lg ring-0 transition-transform",l?"translate-x-5":"translate-x-0")})]})});f.displayName="Switch";function M(){const[t,l]=g.useState("profile"),{user:i}=N(),{theme:o,setTheme:n,language:d,setLanguage:c}=w();v();const x=[{id:"profile",label:"Profil Public",icon:k},{id:"account",label:"Compte & Sécurité",icon:y},{id:"appearance",label:"Apparence",icon:C},{id:"notifications",label:"Notifications",icon:S},{id:"billing",label:"Facturation",icon:A}];return e.jsxs("div",{className:"max-w-6xl mx-auto pb-24 animate-fadeIn",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("h1",{className:"text-3xl font-display font-bold text-white tracking-tight",children:"Paramètres"}),e.jsx("p",{className:"text-kodo-text-dim mt-2 text-lg",children:"Gérez vos préférences système et votre compte."})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-12 gap-8",children:[e.jsx("aside",{className:"lg:col-span-3",children:e.jsxs("nav",{className:"space-y-1 sticky top-32",children:[x.map(a=>e.jsxs("button",{onClick:()=>l(a.id),className:s("w-full flex items-center gap-3 px-4 py-3 rounded-xl transition-all duration-200 text-sm font-medium",t===a.id?"bg-kodo-cyan/10 text-kodo-cyan shadow-[0_0_15px_rgba(102,252,241,0.1)] ring-1 ring-kodo-cyan/20":"text-kodo-text-dim hover:text-white hover:bg-white/5"),children:[e.jsx(a.icon,{className:s("w-5 h-5",t===a.id?"text-kodo-cyan":"text-kodo-steel")}),a.label]},a.id)),e.jsx("div",{className:"pt-8 mt-8 border-t border-white/5",children:e.jsxs(r,{variant:"ghost",className:"w-full justify-start text-kodo-red hover:text-kodo-red hover:bg-kodo-red/10 gap-3",children:[e.jsx(P,{className:"w-5 h-5"}),"Déconnexion"]})})]})}),e.jsxs("main",{className:"lg:col-span-9 space-y-6",children:[t==="profile"&&e.jsx("div",{className:"space-y-6 animate-slideInRight",children:e.jsxs(m,{variant:"glass",children:[e.jsxs(h,{children:[e.jsx(u,{children:"Profil Public"}),e.jsx(p,{children:"C'est ce que les autres utilisateurs verront sur Veza."})]}),e.jsxs(j,{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center gap-6",children:[e.jsx("div",{className:"w-24 h-24 rounded-full bg-gradient-to-br from-kodo-cyan to-kodo-magenta p-[2px]",children:e.jsxs("div",{className:"w-full h-full rounded-full bg-kodo-ink flex items-center justify-center overflow-hidden relative group",children:[e.jsx("span",{className:"text-3xl font-bold text-white",children:i?.username?.substring(0,2).toUpperCase()}),e.jsx("div",{className:"absolute inset-0 bg-black/60 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity cursor-pointer",children:e.jsx("span",{className:"text-xs text-white",children:"Modifier"})})]})}),e.jsxs("div",{children:[e.jsx(r,{variant:"outline",size:"sm",children:"Changer l'avatar"}),e.jsx("p",{className:"text-xs text-kodo-text-dim mt-2",children:"JPG, GIF ou PNG. Max 2MB."})]})]}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium text-kodo-text-dim",children:"Nom d'utilisateur"}),e.jsx(b,{defaultValue:i?.username})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium text-kodo-text-dim",children:"Site Web"}),e.jsx(b,{placeholder:"https://..."})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium text-kodo-text-dim",children:"Bio"}),e.jsx("textarea",{className:"w-full h-32 bg-kodo-graphite/40 border border-white/5 rounded-xl p-4 text-sm text-white focus:ring-2 focus:ring-kodo-cyan/20 focus:border-kodo-cyan/50 resize-none",placeholder:"Dites-nous en plus sur vous..."})]})]})]})}),t==="appearance"&&e.jsx("div",{className:"space-y-6 animate-slideInRight",children:e.jsxs(m,{variant:"glass",children:[e.jsxs(h,{children:[e.jsx(u,{children:"Thème & Interface"}),e.jsx(p,{children:"Personnalisez votre expérience visuelle sur VezaOS."})]}),e.jsxs(j,{className:"grid gap-6",children:[e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsxs("button",{onClick:()=>n("light"),className:s("border-2 rounded-xl p-4 flex flex-col items-center gap-3 transition-all",o==="light"?"border-kodo-cyan bg-kodo-cyan/5":"border-white/5 hover:border-white/10 bg-white/2"),children:[e.jsx("div",{className:"w-full aspect-video bg-[#FCFDFE] rounded-lg border border-slate-200 shadow-sm"}),e.jsx("span",{className:"text-sm font-medium text-white",children:"Ceramic Light"})]}),e.jsxs("button",{onClick:()=>n("dark"),className:s("border-2 rounded-xl p-4 flex flex-col items-center gap-3 transition-all",o==="dark"?"border-kodo-cyan bg-kodo-cyan/5":"border-white/5 hover:border-white/10 bg-white/2"),children:[e.jsx("div",{className:"w-full aspect-video bg-[#0B0D11] rounded-lg border border-white/10 shadow-sm"}),e.jsx("span",{className:"text-sm font-medium text-white",children:"Void Pro"})]}),e.jsxs("button",{onClick:()=>n("system"),className:s("border-2 rounded-xl p-4 flex flex-col items-center gap-3 transition-all",o==="system"?"border-kodo-cyan bg-kodo-cyan/5":"border-white/5 hover:border-white/10 bg-white/2"),children:[e.jsx("div",{className:"w-full aspect-video bg-gradient-to-br from-slate-800 to-slate-200 rounded-lg border border-white/10"}),e.jsx("span",{className:"text-sm font-medium text-white",children:"Système"})]})]}),e.jsxs("div",{className:"flex items-center justify-between py-4 border-t border-white/5",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("h4",{className:"text-sm font-medium text-white flex items-center gap-2",children:[e.jsx(I,{className:"w-4 h-4 text-kodo-cyan"})," Langue"]}),e.jsx("p",{className:"text-xs text-kodo-text-dim",children:"Langue de l'interface"})]}),e.jsxs("div",{className:"flex bg-white/5 p-1 rounded-lg",children:[e.jsx("button",{onClick:()=>c("fr"),className:s("px-3 py-1 text-xs font-medium rounded-md transition-all",d==="fr"?"bg-white/10 text-white":"text-kodo-text-dim"),children:"Français"}),e.jsx("button",{onClick:()=>c("en"),className:s("px-3 py-1 text-xs font-medium rounded-md transition-all",d==="en"?"bg-white/10 text-white":"text-kodo-text-dim"),children:"English"})]})]})]})]})}),t==="account"&&e.jsx("div",{className:"space-y-6 animate-slideInRight",children:e.jsxs(m,{variant:"glass",children:[e.jsxs(h,{children:[e.jsx(u,{children:"Sécurité"}),e.jsx(p,{children:"Gérez vos identifiants et méthodes de connexion."})]}),e.jsxs(j,{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between p-4 rounded-xl border border-white/5 bg-white/2",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"p-2 bg-kodo-cyan/10 rounded-lg text-kodo-cyan",children:e.jsx(z,{className:"w-5 h-5"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-white",children:i?.email}),e.jsx("p",{className:"text-xs text-kodo-text-dim",children:"Adresse email principale"})]})]}),i?.is_verified?e.jsxs("span",{className:"flex items-center gap-1.5 text-xs font-bold text-kodo-lime bg-kodo-lime/10 px-2 py-1 rounded-full border border-kodo-lime/20",children:[e.jsx(B,{className:"w-3 h-3"})," Vérifié"]}):e.jsx(r,{variant:"outline",size:"sm",children:"Vérifier"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h4",{className:"text-sm font-medium text-white",children:"Authentification"}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx("label",{className:"text-sm text-white",children:"Authentification à deux facteurs (2FA)"}),e.jsx("p",{className:"text-xs text-kodo-text-dim",children:"Ajoute une couche de sécurité supplémentaire."})]}),e.jsx(f,{})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx("label",{className:"text-sm text-white",children:"Alertes de connexion"}),e.jsx("p",{className:"text-xs text-kodo-text-dim",children:"Recevoir un email lors d'une connexion suspecte."})]}),e.jsx(f,{defaultChecked:!0})]})]}),e.jsxs("div",{className:"pt-4 border-t border-white/5",children:[e.jsx("h4",{className:"text-sm font-medium text-kodo-red mb-4",children:"Zone Danger"}),e.jsx(r,{variant:"destructive",className:"w-full sm:w-auto",children:"Supprimer mon compte"})]})]})]})}),e.jsxs("div",{className:"flex justify-end gap-4 sticky bottom-6 bg-kodo-void/80 backdrop-blur-xl p-4 rounded-xl border border-white/5 shadow-2xl",children:[e.jsx(r,{variant:"ghost",children:"Annuler"}),e.jsx(r,{variant:"primary",className:"shadow-glow-cyan",children:"Enregistrer les modifications"})]})]})]})]})}export{M as SettingsPage};