frondend/components/Navbar/ResponsiveNav.tsx

20 lines
672 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 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