import { Link, useLocation } from 'react-router-dom'; const RecipeBookTabs = () => { const location = useLocation(); const tabs = [ { id: '/', label: 'All Recipes', icon: '📚' }, { id: '/recipe/', label: 'Recipe', icon: '🥗' }, { id: '/add-recipe', label: 'Add Recipe', icon: '➕' }, { id: '/about', label: 'About', icon: '🍽️' }, ]; return (
{/* Navigation Tabs */}
{/* Tab Background Line */}
{/* Tabs Container */}
{tabs.map((tab) => { const isActive = location.pathname === tab.id || (location.pathname.startsWith(tab.id) && tab.id === "/recipe/"); return (
{tab.icon} {tab.label}
{/* Tab Shadow Effect */} {isActive && ( <>
)} ); })}
); }; export default RecipeBookTabs;