mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-09-12 19:51:00 +05:00
40 lines
839 B
TypeScript
40 lines
839 B
TypeScript
"use client";
|
|
|
|
import Head from "next/head";
|
|
import { useTheme } from "next-themes";
|
|
import { api } from "@/utils/api";
|
|
|
|
export function WhitelabelingProvider() {
|
|
const { resolvedTheme } = useTheme();
|
|
const { data: config } = api.whitelabeling.getPublic.useQuery(undefined, {
|
|
staleTime: 5 * 60 * 1000,
|
|
refetchOnWindowFocus: false,
|
|
});
|
|
|
|
const faviconHref =
|
|
config?.faviconUrl ??
|
|
(resolvedTheme === "dark"
|
|
? "/icon-dark.svg"
|
|
: resolvedTheme === "light"
|
|
? "/icon-light.svg"
|
|
: "/icon.svg");
|
|
|
|
return (
|
|
<>
|
|
<Head>
|
|
{config?.metaTitle && <title>{config.metaTitle}</title>}
|
|
<link rel="icon" href={faviconHref} key="app-favicon" />
|
|
</Head>
|
|
|
|
{config?.customCss && (
|
|
<style
|
|
id="whitelabeling-styles"
|
|
dangerouslySetInnerHTML={{
|
|
__html: config.customCss,
|
|
}}
|
|
/>
|
|
)}
|
|
</>
|
|
);
|
|
}
|