1// SPDX-License-Identifier: GPL-2.0-only
2// Copyright (c) 2025-present FERS Contributors (see AUTHORS.md).
4import PlayArrowIcon from '@mui/icons-material/PlayArrow';
5import SettingsIcon from '@mui/icons-material/Settings';
6import TerminalIcon from '@mui/icons-material/Terminal';
7import ViewInArIcon from '@mui/icons-material/ViewInAr';
8import WidgetsIcon from '@mui/icons-material/Widgets';
16} from '@mui/material';
17import { useFersLogStore } from '@/stores/fersLogStore';
19interface AppRailProps {
21 onViewChange: (view: string) => void;
22 onSettingsClick: () => void;
26 { id: 'scenario', label: 'Scenario Builder', icon: <ViewInArIcon /> },
27 { id: 'assets', label: 'Asset Library', icon: <WidgetsIcon /> },
28 { id: 'simulation', label: 'Simulation Run', icon: <PlayArrowIcon /> },
31export default function AppRail({
36 const logOpen = useFersLogStore((state) => state.isOpen);
37 const toggleLogOpen = useFersLogStore((state) => state.toggleOpen);
38 const logCount = useFersLogStore((state) => state.entries.length);
44 height: '100%', // Use percentage instead of vh
46 flexDirection: 'column',
49 borderColor: 'divider',
50 bgcolor: 'background.paper',
52 overflow: 'hidden', // Prevent overflow
55 <List sx={{ flexGrow: 1, overflow: 'auto', width: '100%' }}>
56 {views.map((view) => (
57 <Tooltip title={view.label} placement="right" key={view.id}>
59 selected={activeView === view.id}
60 onClick={() => onViewChange(view.id)}
63 justifyContent: 'center',
66 backgroundColor: 'action.selected',
70 <ListItemIcon sx={{ minWidth: 0 }}>
78 <Tooltip title="Raw logs" placement="right">
81 onClick={toggleLogOpen}
84 justifyContent: 'center',
86 backgroundColor: 'action.selected',
90 <ListItemIcon sx={{ minWidth: 0 }}>
92 badgeContent={logCount}
95 invisible={logCount === 0}
102 <Tooltip title="Settings" placement="right">
104 onClick={onSettingsClick}
105 sx={{ my: 1, justifyContent: 'center' }}
107 <ListItemIcon sx={{ minWidth: 0 }}>