import { Box, Chip, Icon, IconButton, ListItem, ListItemText, useTheme, } from '@mui/material'; import {TripAlertEntity} from '../../generated/graphql'; import {useTranslation} from 'react-i18next'; import RadarIcon from '@mui/icons-material/Radar'; import useProfile from '../../hooks/useProfile'; type Props = { tripAlert: TripAlertEntity; onClick: () => void; isLast?: boolean; }; const WaitingListItem = ({tripAlert, onClick, isLast}: Props) => { const {t} = useTranslation(); const theme = useTheme(); const {userId} = useProfile(); const user = tripAlert.attributes.user?.data.attributes; const userName = `${user.firstName} ${user.lastName}`; const isLoggedUser = `${userId}` === tripAlert.attributes.user?.data.id; return ( {userName} {isLoggedUser && ( )} } secondary={ <> {tripAlert.attributes.address} {tripAlert.attributes.radius} km } /> {t('passenger.actions.place')} chevron_right ); }; export default WaitingListItem;