2025-05-05 17:27:36 +08:00
|
|
|
'use client';
|
2025-04-16 04:45:46 +08:00
|
|
|
|
2025-05-05 17:27:36 +08:00
|
|
|
import Image from 'next/image';
|
|
|
|
import { useTheme } from 'next-themes';
|
|
|
|
import { useEffect, useState } from 'react';
|
2025-04-16 04:45:46 +08:00
|
|
|
|
2025-06-01 04:53:53 +08:00
|
|
|
interface KortixLogoProps {
|
|
|
|
size?: number;
|
|
|
|
}
|
|
|
|
export function KortixLogo({ size = 24 }: KortixLogoProps) {
|
2025-07-05 04:56:08 +08:00
|
|
|
const { theme, systemTheme } = useTheme();
|
2025-05-05 17:27:36 +08:00
|
|
|
const [mounted, setMounted] = useState(false);
|
|
|
|
|
2025-04-16 08:04:04 +08:00
|
|
|
// After mount, we can access the theme
|
|
|
|
useEffect(() => {
|
2025-05-05 17:27:36 +08:00
|
|
|
setMounted(true);
|
|
|
|
}, []);
|
|
|
|
|
2025-07-05 04:56:08 +08:00
|
|
|
const shouldInvert = mounted && (
|
|
|
|
theme === 'dark' || (theme === 'system' && systemTheme === 'dark')
|
|
|
|
);
|
|
|
|
|
2025-04-16 04:45:46 +08:00
|
|
|
return (
|
2025-06-01 04:53:53 +08:00
|
|
|
<Image
|
2025-04-16 04:45:46 +08:00
|
|
|
src="/kortix-symbol.svg"
|
|
|
|
alt="Kortix"
|
2025-06-01 04:53:53 +08:00
|
|
|
width={size}
|
|
|
|
height={size}
|
2025-07-05 04:56:08 +08:00
|
|
|
className={`${shouldInvert ? 'invert' : ''} flex-shrink-0`}
|
2025-04-16 04:45:46 +08:00
|
|
|
/>
|
2025-05-05 17:27:36 +08:00
|
|
|
);
|
|
|
|
}
|