import { useState } from 'react'; import type { ReactNode } from 'react'; import { useLocation, Link, useNavigate } from 'react-router-dom'; import { Search } from 'lucide-react'; import { NAV_ITEMS } from '../../constants'; export const Layout = ({ children }: { children: ReactNode }) => { const location = useLocation(); const navigate = useNavigate(); const [isSearchOpen, setIsSearchOpen] = useState(false); const [searchQuery, setSearchQuery] = useState(''); const isActive = (path: string) => { if (path === '/') return location.pathname === '/' && !location.search; return location.pathname + location.search === path; }; const handleSearch = (e: React.FormEvent) => { e.preventDefault(); if (searchQuery.trim()) { navigate(`/?q=${encodeURIComponent(searchQuery)}`); // Optional: close search or keep it open } }; return (
{/* Sidebar Navigation */} {/* Mobile Bottom Nav (Visible only on small screens) */}
{NAV_ITEMS.slice(0, 4).map((item) => ( {item.name} ))} {/* APK Download in Mobile Nav */}
TV App
{/* Main Content Area */}
{children}
); };