2023-04-22 20:16:47 +02:00
|
|
|
"use client";
|
2023-04-20 17:07:26 +02:00
|
|
|
|
2023-04-24 16:30:21 +02:00
|
|
|
import { setTheme, LabelPolicyColors } from "#/utils/colors";
|
2023-04-24 15:32:57 +02:00
|
|
|
import { useEffect } from "react";
|
2023-04-21 16:13:52 +02:00
|
|
|
|
2023-04-22 20:16:47 +02:00
|
|
|
type Props = {
|
2023-04-24 16:30:21 +02:00
|
|
|
branding: LabelPolicyColors | undefined;
|
2023-04-22 20:16:47 +02:00
|
|
|
children: React.ReactNode;
|
|
|
|
|
};
|
2023-04-21 13:49:15 +02:00
|
|
|
|
2023-04-22 20:16:47 +02:00
|
|
|
const ThemeWrapper = ({ children, branding }: Props) => {
|
2023-04-24 15:32:57 +02:00
|
|
|
useEffect(() => {
|
2023-04-24 16:30:21 +02:00
|
|
|
setTheme(document, branding);
|
2023-04-24 15:32:57 +02:00
|
|
|
}, []);
|
2023-04-24 09:54:47 +02:00
|
|
|
|
2023-04-22 20:16:47 +02:00
|
|
|
const defaultClasses = "bg-background-light-600 dark:bg-background-dark-600";
|
2023-04-21 13:49:15 +02:00
|
|
|
|
2023-04-24 09:54:47 +02:00
|
|
|
return <div className={defaultClasses}>{children}</div>;
|
2023-04-20 17:07:26 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default ThemeWrapper;
|