1import{a4 as u,r as x,j as e,a5 as m}from"./index--27B4B2I.js";function f(){const a=u.useLoaderData(),{authorization_id:o}=u.useSearch(),[r,t]=x.useState(!1),[i,s]=x.useState(null);async function c(b){t(!0),s(null);const{data:n,error:d}=b?await m.approveAuthorization(o):await m.denyAuthorization(o);if(d){t(!1),s(d.message);return}const p=n?.redirect_url??n?.redirect_to;if(!p){t(!1),s("Nessun redirect restituito dal server di autorizzazione.");return}window.location.href=p}const l=a?.client?.name??"Applicazione esterna";return e.jsx("main",{className:"min-h-screen flex items-center justify-center bg-cream p-6",children:e.jsxs("div",{className:"w-full max-w-md bg-white border border-border p-8 shadow-sm",children:[e.jsx("div",{className:"eyebrow mb-3",children:"Agent integrations"}),e.jsxs("h1",{className:"font-display text-2xl text-charcoal mb-2",children:["Collega ",l," al tuo account Marabotto"]}),e.jsxs("p",{className:"text-charcoal/70 text-sm mb-4",children:[l," potrà usare i tool di questa app come te finché sei collegato. I permessi dell'app e le policy del database continuano ad applicarsi."]}),a?.redirect_uri&&e.jsxs("p",{className:"text-charcoal/60 text-xs mb-4 break-all",children:["Redirect: ",e.jsx("span",{className:"font-mono",children:a.redirect_uri})]}),i&&e.jsx("p",{role:"alert",className:"text-red-600 text-sm border border-red-200 bg-red-50 px-3 py-2 mb-4",children:i}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx("button",{disabled:r,onClick:()=>c(!0),className:"flex-1 px-5 py-3 bg-gold text-gold-foreground text-[11px] tracking-[0.22em] uppercase hover:bg-gold-dark disabled:opacity-50",children:r?"â¦":"Approva"}),e.jsx("button",{disabled:r,onClick:()=>c(!1),className:"flex-1 px-5 py-3 border border-border text-[11px] tracking-[0.22em] uppercase text-charcoal hover:bg-charcoal/5 disabled:opacity-50",children:"Rifiuta"})]})]})})}export{f 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.