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

115 lines
3.2 KiB
TypeScript
Raw Normal View History

2024-06-24 22:42:37 +05:30
import * as React from 'react';
import Tabs from '@mui/material/Tabs';
import Tab from '@mui/material/Tab';
import Box from '@mui/material/Box';
2024-10-28 18:45:51 +05:30
import { Paper, Button } from "@mui/material";
2024-10-29 08:45:09 +05:30
import { AutoAwesome, FormatListBulleted, VpnKey, Usb, Article, Link, CloudQueue } from "@mui/icons-material";
2024-06-24 22:42:37 +05:30
interface MainMenuProps {
value: string;
handleChangeContent: (newValue: string) => void;
}
export const MainMenu = ({ value = 'recordings', handleChangeContent }: MainMenuProps) => {
const handleChange = (event: React.SyntheticEvent, newValue: string) => {
handleChangeContent(newValue);
};
return (
<Paper
sx={{
height: 'auto',
2024-10-10 23:15:28 +05:30
width: '250px',
2024-10-10 23:10:35 +05:30
backgroundColor: 'white',
2024-10-29 08:45:09 +05:30
paddingTop: '0.5rem',
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
>
<Box sx={{
width: '100%',
2024-10-29 08:45:09 +05:30
paddingBottom: '1rem',
2024-06-24 22:42:37 +05:30
}}>
<Tabs
value={value}
onChange={handleChange}
textColor="primary"
indicatorColor="primary"
orientation="vertical"
2024-10-28 18:47:17 +05:30
sx={{ alignItems: 'flex-start' }}
2024-06-24 22:42:37 +05:30
>
2024-10-28 18:47:17 +05:30
<Tab
sx={{
justifyContent: 'flex-start',
textAlign: 'left',
fontSize: 'medium',
}}
value="recordings"
label="Robots"
icon={<AutoAwesome />}
iconPosition="start"
/>
<Tab
sx={{
justifyContent: 'flex-start',
textAlign: 'left',
fontSize: 'medium',
}}
value="runs"
label="Runs"
icon={<FormatListBulleted />}
iconPosition="start"
/>
<Tab
sx={{
justifyContent: 'flex-start',
textAlign: 'left',
fontSize: 'medium',
}}
value="proxy"
label="Proxy"
icon={<Usb />}
iconPosition="start"
/>
<Tab
sx={{
justifyContent: 'flex-start',
textAlign: 'left',
fontSize: 'medium',
}}
value="apikey"
label="API Key"
icon={<VpnKey />}
iconPosition="start"
/>
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-10-29 08:45:09 +05:30
<Button href="https://docs.maxun.io/" target="_blank" rel="noopener noreferrer" sx={buttonStyles} startIcon={<Article />}>
Documentation
2024-10-29 05:42:08 +05:30
</Button>
2024-10-29 08:45:09 +05:30
<Button href="http://localhost:8080/api-docs/" target="_blank" rel="noopener noreferrer" sx={buttonStyles} startIcon={<Link />}>
API Docs
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-10-29 05:12:41 +05:30
const buttonStyles = {
justifyContent: 'flex-start',
textAlign: 'left',
fontSize: 'medium',
2024-10-29 08:47:35 +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-10-29 08:45:09 +05:30
color: '#6C6C6C !important',
2024-10-29 08:45:32 +05:30
};