// @mui
import { alpha, useTheme } from '@mui/material/styles';
import Box from '@mui/material/Box';
import Stack from '@mui/material/Stack';
import ButtonBase from '@mui/material/ButtonBase';
// ----------------------------------------------------------------------
type Props = {
options: string[];
value: string;
onChange: (newValue: string) => void;
};
export default function LayoutOptions({ options, value, onChange }: Props) {
const theme = useTheme();
const renderNav = (option: string, selected: boolean) => {
const background = `linear-gradient(135deg, ${theme.palette.primary.light} 0%, ${theme.palette.primary.main} 100%)`;
const baseStyles = {
flexShrink: 0,
borderRadius: 0.5,
bgcolor: 'grey.500',
};
const circle = (
);
const primaryItem = (
);
const secondaryItem = (
);
return (
{circle}
{primaryItem}
{secondaryItem}
);
};
const renderContent = (selected: boolean) => (
);
return (
{options.map((option) => {
const selected = value === option;
return (
onChange(option)}
sx={{
p: 0,
width: 1,
height: 56,
borderRadius: 1,
border: `solid 1px ${alpha(theme.palette.grey[500], 0.08)}`,
...(selected && {
bgcolor: 'background.paper',
boxShadow: `-24px 8px 24px -4px ${alpha(
theme.palette.mode === 'light'
? theme.palette.grey[500]
: theme.palette.common.black,
0.08
)}`,
}),
...(option === 'horizontal' && {
flexDirection: 'column',
}),
}}
>
{renderNav(option, selected)}
{renderContent(selected)}
);
})}
);
}