mirror of
https://github.com/ajnart/homarr.git
synced 2026-03-02 02:10:59 +01:00
* chore(deps): update dependency tsx to v4.11.0 * fix: build not working --------- Co-authored-by: homarr-renovate[bot] <158783068+homarr-renovate[bot]@users.noreply.github.com> Co-authored-by: Meier Lukas <meierschlumpf@gmail.com>
16 lines
512 B
TypeScript
16 lines
512 B
TypeScript
import Script from "next/script";
|
|
|
|
import { UMAMI_WEBSITE_ID } from "@homarr/analytics";
|
|
import { api } from "@homarr/api/server";
|
|
|
|
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 api.serverSettings.getAnalytics().catch(() => null);
|
|
|
|
if (analytics?.enableGeneral) {
|
|
return <Script src="https://umami.homarr.dev/script.js" data-website-id={UMAMI_WEBSITE_ID} defer />;
|
|
}
|
|
|
|
return <></>;
|
|
};
|