'use client';
import Link from 'next/link';
import { useEffect, useState } from 'react';
import { usePathname } from 'next/navigation';
const leftItems = [
{ href: '/feed', label: 'Feed', icon: '🏠' },
{ href: '/explore', label: 'Entdecken', icon: '🔍' },
];
const rightItems = [
{ href: '/pets', label: 'Tiere', icon: '🐾' },
{ href: '/profile', label: 'Profil', icon: '👤' },
];
function NavItem({
item,
pathname,
}: {
item: { href: string; label: string; icon: string };
pathname: string;
}) {
const isActive =
item.href === '/feed'
? pathname === '/feed'
: pathname.startsWith(item.href);
return (
{
(e.currentTarget as HTMLElement).style.transform = 'scale(0.9)';
}}
onMouseUp={(e) => {
(e.currentTarget as HTMLElement).style.transform = 'scale(1)';
}}
onMouseLeave={(e) => {
(e.currentTarget as HTMLElement).style.transform = 'scale(1)';
}}
>
{item.icon}
{item.label}
{isActive && (
)}
);
}
export default function BottomNav() {
const [isLoggedIn, setIsLoggedIn] = useState(false);
const pathname = usePathname();
useEffect(() => {
const hasAuthCookie = document.cookie
.split('; ')
.some((c) => c.startsWith('onlypets-auth=true'));
setIsLoggedIn(hasAuthCookie);
}, []);
if (!isLoggedIn) return null;
return (
);
}