frondend/components/Navbar/ResponsiveNav.tsx

20 lines
672 B
TypeScript
Raw Normal View History

2024-10-05 15:04:17 +08:00
"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