mirror of
https://github.com/ichsankurnia/hats-app.git
synced 2026-12-05 11:06:29 +00:00
b57ad30bfe
Switch the dashboard logo between light and dark variants based on the active theme, and add the light logo asset.
28 lines
909 B
TypeScript
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; |