mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-25 08:46:22 +02:00
- Add optional priority prop to Logo component (defaults to false) - Set priority=true on login and register pages to preload logo - Logo on other pages remains lazy-loaded by default - Improves LCP on critical auth pages by eliminating lazy-load delay
34 lines
555 B
TypeScript
34 lines
555 B
TypeScript
import Image from "next/image";
|
|
import Link from "next/link";
|
|
import { cn } from "@/lib/utils";
|
|
|
|
export const Logo = ({
|
|
className,
|
|
disableLink = false,
|
|
priority = false,
|
|
}: {
|
|
className?: string;
|
|
disableLink?: boolean;
|
|
priority?: boolean;
|
|
}) => {
|
|
const image = (
|
|
<Image
|
|
src="/icon-128.svg"
|
|
className={cn("select-none dark:invert", className)}
|
|
alt="logo"
|
|
width={128}
|
|
height={128}
|
|
priority={priority}
|
|
/>
|
|
);
|
|
|
|
if (disableLink) {
|
|
return image;
|
|
}
|
|
|
|
return (
|
|
<Link href="/" className="select-none">
|
|
{image}
|
|
</Link>
|
|
);
|
|
};
|