import { Link, usePage } from "@inertiajs/react";
import logoUwilSupportDark from "&/images/logos/uwil-support-dark.svg";
import logoTinyUwilSupport from "&/images/logos/uwil-support-light-icon.svg";
import logoUwilSupportLight from "&/images/logos/uwil-support-light.svg";
import { useTheme } from "@/back/providers/ThemeProvider";
import { type ConfigBackend } from "@/back/types/global";
interface ApplicationLogoProps {
forceLight?: boolean;
isCollapsed?: boolean;
}
/**
* Get the logo.
*
* @param isCollapsed boolean
* @param forceLight boolean
* @param theme string
* @return string
*/
function getLogo(isCollapsed: boolean, forceLight: boolean, theme: string) {
if (isCollapsed) return logoTinyUwilSupport;
if (forceLight || theme === "dark") return logoUwilSupportLight;
return logoUwilSupportDark;
}
export default function ApplicationLogo({
forceLight = false,
isCollapsed = false,
}: ApplicationLogoProps) {
const { routes } = usePage().props.configBackend as ConfigBackend;
const { theme } = useTheme();
const wrapperClasses = isCollapsed ? "h-8" : "w-full max-w-[10rem] mx-auto";
const logo = getLogo(isCollapsed, forceLight, theme);
return (
);
}