fix: linting cleanup, TS errors, mobile cookie banner and hero max-width

This commit is contained in:
MichalC
2026-08-01 12:27:14 +02:00
parent 02cb49e180
commit 88cb4c516d
49 changed files with 167 additions and 125 deletions
+12 -3
View File
@@ -1,15 +1,24 @@
'use client';
declare global {
interface Window {
grecaptcha: {
ready: (cb: () => void) => void;
execute: (siteKey: string, options: { action: string }) => Promise<string>;
};
}
}
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) {
if (typeof window === 'undefined' || !siteKey || !window.grecaptcha) {
resolve(null);
return;
}
try {
(window as any).grecaptcha.ready(() => {
(window as any).grecaptcha
window.grecaptcha.ready(() => {
window.grecaptcha
.execute(siteKey, { action })
.then((token: string) => resolve(token))
.catch(() => resolve(null));