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-12-10 20:40:59 +05:30
|
|
|
import { useTranslation } from 'react-i18next';
|
|
|
|
|
import i18n from '../../i18n';
|
|
|
|
|
|
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-12-10 20:40:59 +05:30
|
|
|
const {t} = useTranslation();
|
2024-06-24 22:42:37 +05:30
|
|
|
|
|
|
|
|
const handleChange = (event: React.SyntheticEvent, newValue: string) => {
|
|
|
|
|
handleChangeContent(newValue);
|
|
|
|
|
};
|
|
|
|
|
|
2024-11-07 10:43:13 +05:30
|
|
|
// 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',
|
2024-11-07 10:43:13 +05:30
|
|
|
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"
|
2024-11-24 01:10:22 +05:30
|
|
|
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
|
|
|
|
|
},
|
|
|
|
|
}}
|
2024-11-07 10:43:13 +05:30
|
|
|
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
|
|
|
|
|
},
|
2024-11-24 01:10:22 +05:30
|
|
|
'& .MuiTabs-indicator': {
|
|
|
|
|
backgroundColor: '#ff00c3', // Custom color for the indicator
|
|
|
|
|
},
|
|
|
|
|
|
2024-11-07 10:43:13 +05:30
|
|
|
},
|
|
|
|
|
}}
|
2024-06-24 22:42:37 +05:30
|
|
|
>
|
2024-10-28 18:47:17 +05:30
|
|
|
<Tab
|
|
|
|
|
value="recordings"
|
2024-12-10 20:40:59 +05:30
|
|
|
label={t('mainmenu.recordings')}
|
2024-10-28 18:47:17 +05:30
|
|
|
icon={<AutoAwesome />}
|
|
|
|
|
iconPosition="start"
|
2024-11-24 01:10:22 +05:30
|
|
|
|
2024-10-28 18:47:17 +05:30
|
|
|
/>
|
|
|
|
|
<Tab
|
|
|
|
|
value="runs"
|
2024-12-10 20:40:59 +05:30
|
|
|
label={t('mainmenu.runs')}
|
2024-10-28 18:47:17 +05:30
|
|
|
icon={<FormatListBulleted />}
|
|
|
|
|
iconPosition="start"
|
2024-11-24 01:10:22 +05:30
|
|
|
|
2024-10-28 18:47:17 +05:30
|
|
|
/>
|
|
|
|
|
<Tab
|
|
|
|
|
value="proxy"
|
2024-12-10 20:40:59 +05:30
|
|
|
label={t('mainmenu.proxy')}
|
2024-10-28 18:47:17 +05:30
|
|
|
icon={<Usb />}
|
|
|
|
|
iconPosition="start"
|
2024-11-24 01:10:22 +05:30
|
|
|
|
2024-10-28 18:47:17 +05:30
|
|
|
/>
|
|
|
|
|
<Tab
|
|
|
|
|
value="apikey"
|
2024-12-10 20:40:59 +05:30
|
|
|
label={t('mainmenu.apikey')}
|
2024-10-28 18:47:17 +05:30
|
|
|
icon={<VpnKey />}
|
|
|
|
|
iconPosition="start"
|
2024-11-24 01:10:22 +05:30
|
|
|
|
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-06 23:48:18 +05:30
|
|
|
<Button href={`${apiUrl}/api-docs/`} target="_blank" rel="noopener noreferrer" sx={buttonStyles} startIcon={<Code />}>
|
2024-12-10 20:40:59 +05:30
|
|
|
{t('mainmenu.apidocs')}
|
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 />}>
|
2024-12-10 20:40:59 +05:30
|
|
|
{t('mainmenu.feedback')}
|
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',
|
2024-12-08 04:49:29 +05:30
|
|
|
backgroundColor: 'transparent',
|
|
|
|
|
'&:hover': {
|
|
|
|
|
backgroundColor: 'rgba(255, 0, 195, 0.1)',
|
|
|
|
|
color: '#ff00c3',
|
|
|
|
|
},
|
2024-11-07 00:46:47 +05:30
|
|
|
};
|