RelayAdminButton.tsx raw
1 import { usePrimaryPage } from '@/PageManager'
2 import { useKeyboardNavigation } from '@/providers/KeyboardNavigationProvider'
3 import { Server } from 'lucide-react'
4 import SidebarItem from './SidebarItem'
5
6 export default function RelayAdminButton({
7 collapse,
8 navIndex
9 }: {
10 collapse: boolean
11 navIndex?: number
12 }) {
13 const { current, navigate, display } = usePrimaryPage()
14 const { clearColumn } = useKeyboardNavigation()
15
16 const handleClick = () => {
17 navigate('relay')
18 clearColumn(1)
19 }
20
21 return (
22 <SidebarItem
23 title="Relay"
24 onClick={handleClick}
25 collapse={collapse}
26 active={display && current === 'relay'}
27 navIndex={navIndex}
28 >
29 <Server />
30 </SidebarItem>
31 )
32 }
33