21 lines
720 B
TypeScript
21 lines
720 B
TypeScript
"use client"
|
|
import React, {useState} from 'react'
|
|
import MobileNav from './MobileNav'
|
|
import Nav from './Nav'
|
|
import { CoursesProps,SettingsProps } from '@/types'
|
|
|
|
const ResponsiveNav = ({ courses, settings }: { courses: CoursesProps[], settings: SettingsProps }) => {
|
|
const [showNav, setShowNav] = useState(false)
|
|
const toggleNavHandler = () => setShowNav(!showNav)
|
|
const showNavHandler = () => setShowNav(true)
|
|
const closeNavHandler = () => setShowNav(false)
|
|
|
|
return (
|
|
<div>
|
|
<Nav openNav={toggleNavHandler} showNav={showNav} courses={courses} settings={settings} />
|
|
<MobileNav showNav={showNav} closeNav={closeNavHandler} courses={courses} />
|
|
</div>
|
|
)
|
|
}
|
|
export default ResponsiveNav
|