%PDF- %PDF-
| Direktori : /home2/rezakur1/ai.rezakurnia.com/assets/ |
| Current File : //home2/rezakur1/ai.rezakurnia.com/assets/GoogleAuthButton-6R3YXbli.js |
import{r as t,a as c,j as s}from"./index-CYXd_ywS.js";import{B as u}from"./Button-BtCTiucz.js";function f(){const[i,l]=t.useState(!1),[a,n]=t.useState(!1);t.useEffect(()=>{let e=!1;return c("/auth/google/config").then(o=>{e||l(o.enabled)}).catch(()=>{e||l(!1)}),()=>{e=!0}},[]);const r=t.useCallback(async()=>{if(!a){n(!0);try{const e=await c("/auth/google/url");window.location.assign(e.url)}catch{n(!1)}}},[a]);return i?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("span",{className:"h-px flex-1 bg-white/[0.08]"}),s.jsx("span",{className:"text-xs text-slate-500",children:"atau"}),s.jsx("span",{className:"h-px flex-1 bg-white/[0.08]"})]}),s.jsxs(u,{type:"button",variant:"ghost",size:"lg",className:"w-full",onClick:r,disabled:a,children:[s.jsxs("svg",{viewBox:"0 0 24 24",className:"h-4 w-4","aria-hidden":"true",children:[s.jsx("path",{fill:"#4285F4",d:"M23.49 12.27c0-.79-.07-1.54-.19-2.27H12v4.51h6.47c-.29 1.48-1.14 2.73-2.4 3.58v3h3.86c2.26-2.09 3.56-5.17 3.56-8.82z"}),s.jsx("path",{fill:"#34A853",d:"M12 24c3.24 0 5.95-1.08 7.93-2.91l-3.86-3c-1.08.72-2.45 1.16-4.07 1.16-3.13 0-5.78-2.11-6.73-4.96H1.29v3.09C3.26 21.3 7.31 24 12 24z"}),s.jsx("path",{fill:"#FBBC05",d:"M5.27 14.29c-.25-.72-.38-1.49-.38-2.29s.14-1.57.38-2.29V6.62H1.29C.47 8.24 0 10.06 0 12s.47 3.76 1.29 5.38l3.98-3.09z"}),s.jsx("path",{fill:"#EA4335",d:"M12 4.75c1.77 0 3.35.61 4.6 1.8l3.42-3.42C17.95 1.19 15.24 0 12 0 7.31 0 3.26 2.7 1.29 6.62l3.98 3.09C6.22 6.86 8.87 4.75 12 4.75z"})]}),"Lanjutkan dengan Google"]})]}):null}export{f as G};