diff --git a/apps/console/src/pages/organizations/cookie-banners/configuration/CookieBannerConfigLayout.tsx b/apps/console/src/pages/organizations/cookie-banners/configuration/CookieBannerConfigLayout.tsx index d3120295f..1c262a796 100644 --- a/apps/console/src/pages/organizations/cookie-banners/configuration/CookieBannerConfigLayout.tsx +++ b/apps/console/src/pages/organizations/cookie-banners/configuration/CookieBannerConfigLayout.tsx @@ -18,6 +18,7 @@ import { Badge, Breadcrumb, Button, + IconGlobe, IconListStack, IconPageTextLine, IconSettingsGear2, @@ -242,6 +243,10 @@ export default function CookieBannerConfigLayout({ queryRef }: CookieBannerConfi {__("Cookies")} + + + {__("Translations")} + {__("JS / CSS snippets")} diff --git a/apps/console/src/pages/organizations/cookie-banners/configuration/_components/BannerSettingsForm.tsx b/apps/console/src/pages/organizations/cookie-banners/configuration/_components/BannerSettingsForm.tsx index c41b834cc..5a42182bd 100644 --- a/apps/console/src/pages/organizations/cookie-banners/configuration/_components/BannerSettingsForm.tsx +++ b/apps/console/src/pages/organizations/cookie-banners/configuration/_components/BannerSettingsForm.tsx @@ -30,6 +30,7 @@ const bannerSettingsFormFragment = graphql` privacyPolicyUrl consentExpiryDays consentMode + defaultLanguage } `; @@ -43,6 +44,7 @@ const updateBannerMutation = graphql` privacyPolicyUrl consentExpiryDays consentMode + defaultLanguage latestVersion { id version @@ -70,6 +72,7 @@ export function BannerSettingsForm({ cookieBannerKey }: BannerSettingsFormProps) const [privacyPolicyUrl, setPrivacyPolicyUrl] = useState(banner.privacyPolicyUrl); const [consentExpiryDays, setConsentExpiryDays] = useState(String(banner.consentExpiryDays)); const [consentMode, setConsentMode] = useState(banner.consentMode); + const [defaultLanguage, setDefaultLanguage] = useState(banner.defaultLanguage); const handleSubmit = (e: React.FormEvent) => { e.preventDefault(); @@ -83,6 +86,7 @@ export function BannerSettingsForm({ cookieBannerKey }: BannerSettingsFormProps) privacyPolicyUrl, consentExpiryDays: parseInt(consentExpiryDays, 10), consentMode: consentMode, + defaultLanguage, }, }, onCompleted() { @@ -111,7 +115,7 @@ export function BannerSettingsForm({ cookieBannerKey }: BannerSettingsFormProps) setPrivacyPolicyUrl(e.target.value)} required /> -
+
{__("Opt-out")}
+
+ + +
+ + + + + + + +
+ {showBranding && ( +
+ Privacy by + {" "} + +
+ )} + + ); +} diff --git a/apps/console/src/pages/organizations/cookie-banners/configuration/translations/_components/BannerTranslationSection.tsx b/apps/console/src/pages/organizations/cookie-banners/configuration/translations/_components/BannerTranslationSection.tsx new file mode 100644 index 000000000..fc9eef3ff --- /dev/null +++ b/apps/console/src/pages/organizations/cookie-banners/configuration/translations/_components/BannerTranslationSection.tsx @@ -0,0 +1,131 @@ +// Copyright (c) 2026 Probo Inc . +// +// Permission to use, copy, modify, and/or distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +// AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +// PERFORMANCE OF THIS SOFTWARE. + +import { useTranslate } from "@probo/i18n"; +import { Card, Field, Input, Textarea } from "@probo/ui"; +import { Controller, useFormContext, useWatch } from "react-hook-form"; + +import { BannerPreview } from "./BannerPreview"; +import { TRANSLATION_LABELS } from "./translationDefaults"; +import type { TranslationFormValues } from "./TranslationEditor"; + +interface BannerTranslationSectionProps { + showBranding: boolean; +} + +export function BannerTranslationSection({ + showBranding, +}: BannerTranslationSectionProps) { + const { __ } = useTranslate(); + const { control } = useFormContext(); + + const bannerTitle = useWatch({ control, name: "banner_title" }); + const bannerDescription = useWatch({ control, name: "banner_description" }); + const buttonAcceptAll = useWatch({ control, name: "button_accept_all" }); + const buttonRejectAll = useWatch({ control, name: "button_reject_all" }); + const buttonCustomize = useWatch({ control, name: "button_customize" }); + const privacyPolicyLinkText = useWatch({ + control, + name: "privacy_policy_link_text", + }); + + return ( +
+

{__("Banner")}

+
+ +
+ ( + + + + )} + /> + ( + +