"use client" import React, { useEffect, useState } from 'react' import Link from 'next/link' import { FiChevronDown, FiChevronUp } from 'react-icons/fi'; import { CoursesProps } from '@/types' //define props type type Props = { showNav: boolean; closeNav: () => void courses: CoursesProps[] } const MobileNav = ({ closeNav, showNav, courses }: Props) => { const [dropdownOpen, setDropdownOpen] = useState(false); useEffect(() => { if (showNav) { document.body.classList.add('overflow-hidden'); } else { document.body.classList.remove('overflow-hidden'); } return () => { document.body.classList.remove('overflow-hidden'); }; }, [showNav]); const navOpen = showNav ? 'translate-x-0' : 'translate-x-[-100%]' const navClose = !showNav ? 'translate-x-[-100%]' : 'translate-x-0' return (
主頁
課程
{dropdownOpen ?{course.title}
關於我們