SurfSense/surfsense_web/components/Logo.tsx
SohamBhattacharjee2003 414c4c86e9 fix: add priority prop to Logo component for LCP optimization on auth pages
- 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
2026-04-03 18:32:13 +05:30

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>
);
};