style(forms): ujednolicenie ekranu sukcesu i usuniecie zbednych opcji

This commit is contained in:
MichalC
2026-07-27 22:32:30 +02:00
parent e338c95da0
commit 1a11aecf01
5 changed files with 78 additions and 72 deletions
+21
View File
@@ -0,0 +1,21 @@
'use client';
export function getRecaptchaToken(action: string = 'submit'): Promise<string | null> {
return new Promise((resolve) => {
const siteKey = process.env.NEXT_PUBLIC_RECAPTCHA_SITE_KEY;
if (typeof window === 'undefined' || !siteKey || !(window as any).grecaptcha) {
resolve(null);
return;
}
try {
(window as any).grecaptcha.ready(() => {
(window as any).grecaptcha
.execute(siteKey, { action })
.then((token: string) => resolve(token))
.catch(() => resolve(null));
});
} catch {
resolve(null);
}
});
}