1 | // @mui
|
---|
2 | import { alpha } from '@mui/material/styles';
|
---|
3 | import Box from '@mui/material/Box';
|
---|
4 | import Stack from '@mui/material/Stack';
|
---|
5 | import ButtonBase from '@mui/material/ButtonBase';
|
---|
6 | //
|
---|
7 | import Iconify from '../../iconify';
|
---|
8 |
|
---|
9 | // ----------------------------------------------------------------------
|
---|
10 |
|
---|
11 | type Props = {
|
---|
12 | value: boolean;
|
---|
13 | onChange: VoidFunction;
|
---|
14 | };
|
---|
15 |
|
---|
16 | export default function StretchOptions({ value, onChange }: Props) {
|
---|
17 | return (
|
---|
18 | <ButtonBase
|
---|
19 | onClick={onChange}
|
---|
20 | sx={{
|
---|
21 | width: 1,
|
---|
22 | height: 80,
|
---|
23 | borderRadius: 1,
|
---|
24 | color: 'text.disabled',
|
---|
25 | border: (theme) => `solid 1px ${alpha(theme.palette.grey[500], 0.08)}`,
|
---|
26 | ...(value && {
|
---|
27 | bgcolor: 'background.paper',
|
---|
28 | color: (theme) => theme.palette.primary.main,
|
---|
29 | boxShadow: (theme) =>
|
---|
30 | `-24px 8px 24px -4px ${alpha(
|
---|
31 | theme.palette.mode === 'light' ? theme.palette.grey[500] : theme.palette.common.black,
|
---|
32 | 0.08
|
---|
33 | )}`,
|
---|
34 | }),
|
---|
35 | }}
|
---|
36 | >
|
---|
37 | <Stack
|
---|
38 | direction="row"
|
---|
39 | alignItems="center"
|
---|
40 | justifyContent="space-between"
|
---|
41 | sx={{
|
---|
42 | width: 0.24,
|
---|
43 | transition: (theme) => theme.transitions.create(['width']),
|
---|
44 | ...(value && {
|
---|
45 | width: 0.5,
|
---|
46 | }),
|
---|
47 | }}
|
---|
48 | >
|
---|
49 | <Iconify
|
---|
50 | icon={value ? 'eva:arrow-ios-back-fill' : 'eva:arrow-ios-forward-fill'}
|
---|
51 | sx={{
|
---|
52 | color: (theme) =>
|
---|
53 | `linear-gradient(135deg, ${theme.palette.primary.light} 0%, ${theme.palette.primary.main} 100%)`,
|
---|
54 | }}
|
---|
55 | />
|
---|
56 |
|
---|
57 | <Box sx={{ flexGrow: 1, borderBottom: `dashed 1.5px currentcolor` }} />
|
---|
58 |
|
---|
59 | <Iconify
|
---|
60 | icon={value ? 'eva:arrow-ios-forward-fill' : 'eva:arrow-ios-back-fill'}
|
---|
61 | sx={{
|
---|
62 | color: (theme) =>
|
---|
63 | `linear-gradient(135deg, ${theme.palette.primary.light} 0%, ${theme.palette.primary.main} 100%)`,
|
---|
64 | }}
|
---|
65 | />
|
---|
66 | </Stack>
|
---|
67 | </ButtonBase>
|
---|
68 | );
|
---|
69 | }
|
---|