PageSourceSearch

https://remixo.ai/assets/admin.beta-LaN09a3h.js

js remixo.ai collected 2026-10-05 14:48:48 UTC 5,677 bytes, 1 lines download raw bytes

1import{a as n,B as f,C as v,D as N,E as k,o as q,b as h,r as w,g as l,t,j as e}from"./index-CnqIWqrO.js";function C(){const b=n(f),g=n(v),u=n(N),j=n(k),a=q(),d=h({queryKey:["beta-admin"],queryFn:()=>b()}),c=h({queryKey:["access-requests"],queryFn:()=>g()}),[x,y]=w.useState(!1),m=l({mutationFn:s=>u({data:{betaAccessOnly:s}}),onSuccess:()=>{t.success("Mode bêta mis à jour"),a.invalidateQueries({queryKey:["beta-admin"]}),a.invalidateQueries({queryKey:["beta-gate-status"]})},onError:s=>t.error(s.message)}),o=l({mutationFn:()=>u({data:{rotateToken:!0}}),onSuccess:()=>{t.success("Token régénéré"),a.invalidateQueries({queryKey:["beta-admin"]})},onError:s=>t.error(s.message)}),p=l({mutationFn:s=>j({data:s}),onSuccess:()=>{a.invalidateQueries({queryKey:["access-requests"]})},onError:s=>t.error(s.message)});if(d.isLoading)return e.jsx("p",{className:"text-sm text-muted-foreground",children:"Chargement…"});const r=d.data?.betaAccessOnly??!0,i=d.data?.betaToken??"";return e.jsxs("div",{className:"space-y-8",children:[e.jsxs("section",{className:"rounded-2xl border border-border bg-card p-6",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("span",{className:"chip",children:"Mode d'accès"}),e.jsx("h2",{className:"mt-3 text-2xl font-display",children:"Beta access only"}),e.jsx("p",{className:"mt-1 max-w-md text-sm text-muted-foreground",children:`Quand activé, seuls les super admins et les détenteurs du token peuvent accéder à l'app. Les autres voient un écran "Demander un accès".`})]}),e.jsx("button",{onClick:()=>m.mutate(!r),disabled:m.isPending,className:`rounded-full px-5 py-2.5 text-sm font-medium transition ${r?"bg-destructive text-destructive-foreground hover:bg-destructive/90":"bg-primary text-primary-foreground hover:bg-primary/90"}`,children:r?"Désactiver (ouvrir au public)":"Activer le mode restreint"})]}),e.jsxs("div",{className:"mt-4 inline-flex items-center gap-2 rounded-full border border-border px-3 py-1 text-xs",children:[e.jsx("span",{className:`h-2 w-2 rounded-full ${r?"bg-destructive":"bg-emerald-500"}`}),r?"Restricted":"Ouvert au public"]})]}),e.jsxs("section",{className:"rounded-2xl border border-border bg-card p-6",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("span",{className:"chip",children:"Token secret"}),e.jsx("h2",{className:"mt-3 text-2xl font-display",children:"Token d'accès bêta"}),e.jsx("p",{className:"mt-1 max-w-md text-sm text-muted-foreground",children:"Partage ce token avec les personnes invitées. La régénération invali
1de tous les anciens accès."})]}),e.jsx("button",{onClick:()=>o.mutate(),disabled:o.isPending,className:"rounded-full border border-border px-5 py-2.5 text-sm hover:border-accent",children:o.isPending?"Régénération…":"Régénérer"})]}),e.jsxs("div",{className:"mt-4 flex items-center gap-2 rounded-xl border border-dashed border-border bg-background px-4 py-3 font-mono text-sm",children:[e.jsx("span",{className:"flex-1 truncate",children:x?i:"•".repeat(Math.min(i.length,48))}),e.jsx("button",{onClick:()=>y(s=>!s),className:"rounded-full border border-border px-3 py-1 text-xs hover:border-accent",children:x?"Masquer":"Révéler"}),e.jsx("button",{onClick:()=>{navigator.clipboard.writeText(i),t.success("Token copié")},className:"rounded-full border border-border px-3 py-1 text-xs hover:border-accent",children:"Copier"})]})]}),e.jsxs("section",{children:[e.jsxs("div",{className:"flex items-end justify-between",children:[e.jsx("h2",{className:"text-2xl font-display",children:"Demandes d'accès"}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:[c.data?.length??0," demande(s)"]})]}),e.jsx("div",{className:"mt-4 overflow-hidden rounded-2xl border border-border",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{className:"bg-secondary/50 text-left text-xs uppercase tracking-widest text-muted-foreground",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-4 py-2",children:"Email"}),e.jsx("th",{className:"px-4 py-2",children:"Nom"}),e.jsx("th",{className:"px-4 py-2",children:"Raison"}),e.jsx("th",{className:"px-4 py-2",children:"Statut"}),e.jsx("th",{className:"px-4 py-2",children:"Date"}),e.jsx("th",{className:"px-4 py-2"})]})}),e.jsxs("tbody",{children:[(c.data??[]).map(s=>e.jsxs("tr",{className:"border-t border-border align-top",children:[e.jsx("td",{className:"px-4 py-3 font-mono text-xs",children:s.email}),e.jsx("td",{className:"px-4 py-3",children:s.name??"—"}),e.jsx("td",{className:"px-4 py-3 text-xs text-muted-foreground max-w-sm",children:s.reason??"—"}),e.jsx("td",{className:"px-4 py-3",children:e.jsx("span",{className:"chip",children:s.status})}),e.jsx("td",{className:"px-4 py-3 text-xs text-muted-foreground",children:new Date(s.created_at).toLocaleDateString()}),e.jsx("td",{className:"px-4 py-3 text-right",children:s.status==="pending"?e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx("button",{onClick:()=>p.mutate({id:s.id,status:"approved"}),className:"rounded-full bg-primary px-3 py-1 text-xs text-primary-foreground hover:bg-primary/90",children:"Approuver"}),e.jsx("button",{onClick:()=>p.mutate({id:s.id,status:"rejected"}),className:"rounded-full border border-destructive/40 px-3 py-1 text-xs text-destructive hover:bg-destructive/10",children:"Rejeter"})]}):null})]},s.id)),!c.data?.length&&e.jsx("tr",{children:e.jsx("td",{colSpan:6,className:"px-4 py-6 text-center text-sm text-muted-foreground",children:"Aucune demande pour le moment."})})]})]})})]})]})}export{C as component};

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.