frontend/containers/WaitingList/AssignButton.tsx (view raw)
1import IconButton from '@mui/material/IconButton';
2import Icon from '@mui/material/Icon';
3import {useTheme} from '@mui/material/styles';
4import {useTranslation} from 'react-i18next';
5import ListItemSecondaryAction from '@mui/material/ListItemSecondaryAction';
6
7interface Props {
8 onClick: () => void;
9 tabIndex?: number;
10 disabled: boolean;
11}
12
13const AssignButton = (props: Props) => {
14 const {onClick, tabIndex} = props;
15 const theme = useTheme();
16
17 const {t} = useTranslation();
18
19 return (
20 <ListItemSecondaryAction
21 sx={{
22 top: theme.spacing(3),
23 }}
24 onClick={onClick}
25 tabIndex={tabIndex}
26 >
27 <IconButton
28 sx={{
29 margin: theme.spacing(1, 0, 0, 0),
30 borderRadius: 1,
31 fontSize: theme.typography.subtitle1,
32 padding: 0,
33 lineHeight: 1.5,
34 color: props.disabled ? 'black' : theme.palette.primary.main,
35 }}
36 disabled={props.disabled}
37 size="large"
38 >
39 {t('passenger.actions.place')}
40 <Icon>chevron_right</Icon>
41 </IconButton>
42 </ListItemSecondaryAction>
43 );
44};
45
46export default AssignButton;