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 onClick={onClick}
22 tabIndex={tabIndex}
23 >
24 <IconButton
25 sx={{
26 borderRadius: 1,
27 fontSize: theme.typography.button,
28 padding: 0,
29 color: props.disabled ? 'black' : theme.palette.primary.main,
30 }}
31 disabled={props.disabled}
32 >
33 {t('passenger.actions.place')}
34 <Icon>chevron_right</Icon>
35 </IconButton>
36 </ListItemSecondaryAction>
37 );
38};
39
40export default AssignButton;