Create custom button for Telemtry

This commit is contained in:
Korbs 2024-07-11 18:05:12 -04:00
parent 2f56f1f653
commit 27540e4ae5

View file

@ -0,0 +1,17 @@
---
import i18next,{ t, changeLanguage } from "i18next";
import Base from "@layouts/Default.astro";
if (Astro.cookies.get("Telemtry").value === "Enabled") {
var UserIsOptedIn = true
}
else if (Astro.cookies.get("Telemtry").value === "Disabled") {
var UserIsOptedIn = false
}
---
{UserIsOptedIn ?
<a style="color: white;text-decoration: none;margin-bottom: 6px;border-radius: 6px;padding: 8px 24px;background: #1a1a1a;font-size: 14px;border: 2px rgba(255, 255, 255, 0.25) solid;" href="/api/telemtry/disable">{t("TELEMTRY.OPTOUT")}</a>
:
<a style="color: white;text-decoration: none;margin-bottom: 6px;border-radius: 6px;padding: 8px 24px;background: #1a1a1a;font-size: 14px;border: 2px rgba(255, 255, 255, 0.25) solid;" href="/api/telemtry/enable">{t("TELEMTRY.OPTIN")}</a>
}