refactor: sidebar

This commit is contained in:
codytseng 2025-10-17 23:34:56 +08:00
parent 21663711f8
commit 057de9595b
13 changed files with 110 additions and 44 deletions

View file

@ -2,12 +2,17 @@ import { usePrimaryPage } from '@/PageManager'
import { Home } from 'lucide-react'
import SidebarItem from './SidebarItem'
export default function HomeButton() {
export default function HomeButton({ collapse }: { collapse: boolean }) {
const { navigate, current } = usePrimaryPage()
return (
<SidebarItem title="Home" onClick={() => navigate('home')} active={current === 'home'}>
<Home strokeWidth={3} />
<SidebarItem
title="Home"
onClick={() => navigate('home')}
active={current === 'home'}
collapse={collapse}
>
<Home />
</SidebarItem>
)
}