-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathindex.tsx
34 lines (27 loc) · 875 Bytes
/
index.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
'use client'
import { useSearch } from '@/contexts/SearchContext'
import styles from './HeaderSidebar.module.css'
import SearchNav from '../SearchNav'
import { useLocale } from 'next-intl'
import { getLocaleData } from '@/utils/getLocaleData'
import { ISearchCategory } from '@/interfaces/search'
interface Props {
category: ISearchCategory
}
const HeaderSidebar = ({ category }: Props) => {
const { isSidebarOpen } = useSearch()
const locale = useLocale()
const data = getLocaleData(locale)
return (
<>
{/* Overlay */}
{/* {isOpen && (
<div className={styles.overlay} onClick={() => setIsOpen(false)} />
)} */}
<nav className={`${styles.sidebar} ${isSidebarOpen ? styles.open : ''}`}>
<SearchNav data={data} variant="sidebar" selectedCategory={category} />
</nav>
</>
)
}
export default HeaderSidebar