Files
parcer/src/components/organisms/MainMenu.tsx

128 lines
3.6 KiB
TypeScript
Raw Normal View History

2024-11-07 00:46:47 +05:30
import React from 'react';
2024-06-24 22:42:37 +05:30
import Tabs from '@mui/material/Tabs';
import Tab from '@mui/material/Tab';
import Box from '@mui/material/Box';
2024-11-23 19:11:54 +05:30
2024-11-07 00:46:47 +05:30
import { Paper, Button, useTheme } from "@mui/material";
2024-11-23 19:11:54 +05:30
import { AutoAwesome, FormatListBulleted, VpnKey, Usb, Article, CloudQueue,Code, } from "@mui/icons-material";
2024-11-01 08:25:33 +05:30
import { apiUrl } from "../../apiConfig";
2024-06-24 22:42:37 +05:30
interface MainMenuProps {
value: string;
handleChangeContent: (newValue: string) => void;
}
export const MainMenu = ({ value = 'recordings', handleChangeContent }: MainMenuProps) => {
2024-11-07 00:46:47 +05:30
const theme = useTheme();
2024-06-24 22:42:37 +05:30
const handleChange = (event: React.SyntheticEvent, newValue: string) => {
handleChangeContent(newValue);
};
// Define colors based on theme mode
const defaultcolor = theme.palette.mode === 'light' ? 'black' : 'white';
const selectedPink = '#FF00C3';
2024-06-24 22:42:37 +05:30
return (
<Paper
sx={{
height: 'auto',
2024-10-10 23:15:28 +05:30
width: '250px',
2024-11-07 00:46:47 +05:30
backgroundColor: theme.palette.background.paper,
2024-10-29 08:45:09 +05:30
paddingTop: '0.5rem',
color: defaultcolor,
2024-06-24 22:42:37 +05:30
}}
2024-10-10 23:10:35 +05:30
variant="outlined"
2024-10-23 07:14:31 +05:30
square
2024-06-24 22:42:37 +05:30
>
2024-11-07 00:46:47 +05:30
<Box sx={{ width: '100%', paddingBottom: '1rem' }}>
2024-06-24 22:42:37 +05:30
<Tabs
value={value}
onChange={handleChange}
orientation="vertical"
TabIndicatorProps={{
style: {
backgroundColor: '#ff00c3', // Set the custom color for the indicator here
width: '2px', // Ensure the indicator width is 2px as per your requirement
right: 0, // Position it on the right if needed
},
}}
sx={{
alignItems: 'flex-start',
'& .MuiTab-root': {
color: defaultcolor,
textTransform: 'none', // Non-capitalized text
fontSize: 'medium',
justifyContent: 'flex-start',
textAlign: 'left',
'&.Mui-selected': {
color: selectedPink, // Darker pink for selected tab
},
'& .MuiTabs-indicator': {
backgroundColor: '#ff00c3', // Custom color for the indicator
},
},
}}
2024-06-24 22:42:37 +05:30
>
2024-10-28 18:47:17 +05:30
<Tab
value="recordings"
label="Robots"
icon={<AutoAwesome />}
iconPosition="start"
2024-10-28 18:47:17 +05:30
/>
<Tab
value="runs"
label="Runs"
icon={<FormatListBulleted />}
iconPosition="start"
2024-10-28 18:47:17 +05:30
/>
<Tab
value="proxy"
label="Proxy"
icon={<Usb />}
iconPosition="start"
2024-10-28 18:47:17 +05:30
/>
<Tab
value="apikey"
label="API Key"
icon={<VpnKey />}
iconPosition="start"
2024-10-28 18:47:17 +05:30
/>
2024-09-30 18:06:46 +05:30
</Tabs>
2024-10-28 18:45:51 +05:30
<hr />
<Box sx={{ display: 'flex', flexDirection: 'column', gap: '1rem', textAlign: 'left' }}>
2024-11-23 19:11:54 +05:30
2024-11-07 00:46:47 +05:30
<Button href="/api-docs" target="_blank" rel="noopener noreferrer" sx={buttonStyles} startIcon={<Article />}>
2024-10-29 08:45:09 +05:30
API Docs
2024-11-23 19:11:54 +05:30
2024-10-29 05:42:08 +05:30
</Button>
2024-10-29 08:45:09 +05:30
<Button href="https://forms.gle/hXjgqDvkEhPcaBW76" target="_blank" rel="noopener noreferrer" sx={buttonStyles} startIcon={<CloudQueue />}>
Join Maxun Cloud
2024-10-29 08:28:03 +05:30
</Button>
2024-10-28 18:45:51 +05:30
</Box>
2024-06-24 22:42:37 +05:30
</Box>
</Paper>
);
2024-11-07 00:46:47 +05:30
};
2024-10-29 05:12:41 +05:30
const buttonStyles = {
justifyContent: 'flex-start',
textAlign: 'left',
fontSize: 'medium',
2024-11-07 00:46:47 +05:30
padding: '6px 16px 6px 22px',
2024-10-29 05:12:41 +05:30
minHeight: '48px',
minWidth: '100%',
display: 'flex',
alignItems: 'center',
textTransform: 'none',
2024-11-07 00:46:47 +05:30
color: 'inherit',
};