Files
hats-app/app/(dashboard)/components/Logo.tsx
T
Ichsan Kurniawan b57ad30bfe Use theme-specific dashboard logos
Switch the dashboard logo between light and dark variants based on the active theme, and add the light logo asset.
2026-10-18 19:13:16 +07:00

28 lines
909 B
TypeScript

'use client'
import { FC } from 'react';
import Link from 'next/link';
import { useRouter } from 'next/navigation';
import { cn } from '@/lib/utils';
import { useTheme } from 'next-themes';
type Props = {
className?: string
};
const Logo: FC<Props> = ({ className }) => {
const router = useRouter()
const { theme } = useTheme()
return (
<>
<Link href='/' className={cn('inline-flex items-center space-x-3 hover:opacity-70 duration-300', className)} onClick={() => router.refresh()}>
<div className='flex justify-center items-center h-12 max-w-35 rounded cursor-pointer float-left duration-500'>
<img alt='logo' loading='lazy' src={theme === 'light' ? '/assets/LOGO_HIS_HATs_LIGHT.png' : '/assets/LOGO_HIS_HATs_NI.png'} className='h-full w-full' />
</div>
</Link>
</>
);
}
export default Logo;