Files
open-gsio/packages/client/src/layout/NavItem.tsx
geoffsee 944b956ffd - Refactor BevyScene to replace script injection with dynamic import.
- Update `NavItem` to provide fallback route for invalid `path`.
- Temporarily stub metric API endpoints with placeholders.
2025-07-01 12:28:44 -04:00

44 lines
954 B
TypeScript

import { Box } from '@chakra-ui/react';
import React from 'react';
function NavItem({ path, children, color, onClick, as, cursor }) {
return (
<Box
as={as ?? 'a'}
href={path && path.length > 1 ? path : '/'}
mb={2}
cursor={cursor}
// ml={5}
mr={2}
color={color ?? 'text.accent'}
letterSpacing="normal"
display="block"
position="relative"
textAlign="right"
onClick={onClick}
_after={{
content: '""',
position: 'absolute',
width: '100%',
height: '2px',
bottom: '0',
left: '0',
bg: 'accent.secondary',
transform: 'scaleX(0)',
transformOrigin: 'right',
transition: 'transform 0.3s ease-in-out',
}}
_hover={{
color: 'tertiary.tertiary',
_after: {
transform: 'scaleX(1)',
},
}}
>
{children}
</Box>
);
}
export default NavItem;