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