import {HStack, Flex, Box, useRecipe, useSlotRecipe} from "@chakra-ui/react"; import {NavLink, Outlet, useLocation} from "react-router-dom"; import {SearchBar} from "../../components/dashboard/SearchBar.jsx"; import {SettingsButton} from "../../components/dashboard/SettingsButton.jsx"; // 1. Import your icons (Swap these for whichever you prefer!) import {LayoutDashboard, CalendarDays, Cloud, Satellite, Activity} from "lucide-react"; // 2. Define the tabs array const HOME_TABS = [ {name: "My Dashboard", url: "/home", icon: LayoutDashboard, exact: true}, {name: "Daily Activity", url: "/home/daily", icon: CalendarDays}, {name: "Gas", url: "/home/gas", icon: Cloud}, {name: "Remote Sensing", url: "/home/remote", icon: Satellite}, {name: "Seismic", url: "/home/seismic", icon: Activity}, ]; export default function Home() { const glassTabsRecipe = useRecipe({key: "glassTab"}); const homeRecipe = useSlotRecipe({key: "home"}); const glassTabsStyle = glassTabsRecipe(); const homeStyle = homeRecipe(); const location= useLocation(); const isPersonalDashboard= location.pathname === "/home" || location.pathname === "/home/"; return ( {/* TABS CONTAINER */} {HOME_TABS.map((tab) => { const Icon = tab.icon; return ( {/* CRITICAL: 'end' prop forces exact match so "/home" deactivates on sub-routes*/} {/* flexShrink: 0 ensures the icon never squishes during the gooey animation */} {tab.name} ); })} {/* The Settings button is now inline with the tabs and only renders on the personal dashboard */} {isPersonalDashboard && } {/* EDIT MODE BUTTONS & CONTROLS */} {/* Leaving this HStack here in case you plan to put the SearchBar or other global tools back on the right side */} {/* Future global controls go here */} {/* TABS CONTENT */} ); }