mirror of
https://github.com/ajnart/homarr.git
synced 2026-01-31 03:39:21 +01:00
* feat: add server settings for default board, default color scheme and default locale * chore: address pull request feedback * test: adjust unit tests to match requirements * fix: deepsource issue * chore: add deepsource as dependency to translation library * refactor: restructure language-combobox, adjust default locale for next-intl * chore: change cookie keys prefix from homarr- to homarr.
17 lines
578 B
TypeScript
17 lines
578 B
TypeScript
import Script from "next/script";
|
|
|
|
import { UMAMI_WEBSITE_ID } from "@homarr/analytics";
|
|
import { db } from "@homarr/db";
|
|
import { getServerSettingByKeyAsync } from "@homarr/db/queries";
|
|
|
|
export const Analytics = async () => {
|
|
// For static pages it will not find any analytics data so we do not include the script on them
|
|
const analytics = await getServerSettingByKeyAsync(db, "analytics").catch(() => null);
|
|
|
|
if (analytics?.enableGeneral) {
|
|
return <Script src="https://umami.homarr.dev/script.js" data-website-id={UMAMI_WEBSITE_ID} defer />;
|
|
}
|
|
|
|
return <></>;
|
|
};
|