frontend/containers/PassengersList/ClearButton.tsx (view raw)
1import IconButton from '@material-ui/core/IconButton';
2import Icon from '@material-ui/core/Icon';
3import ListItemSecondaryAction from '@material-ui/core/ListItemSecondaryAction';
4
5interface Props {
6 onClick?: () => void;
7 icon: string;
8}
9
10const ClearButton = (props: Props) => {
11 const {icon, onClick} = props;
12
13 if (onClick)
14 return (
15 <ListItemSecondaryAction>
16 <IconButton size="small" color="primary" onClick={onClick}>
17 <Icon>{icon}</Icon>
18 </IconButton>
19 </ListItemSecondaryAction>
20 );
21
22 return <Icon color="primary">{icon}</Icon>;
23};
24
25export default ClearButton;