import router from 'next/router'; import Card from '@material-ui/core/Card'; import CardActions from '@material-ui/core/CardActions'; import CardContent from '@material-ui/core/CardContent'; import Typography from '@material-ui/core/Typography'; import Button from '@material-ui/core/Button'; import {makeStyles} from '@material-ui/styles'; import {useTranslation} from 'react-i18next'; import {EventEntity} from '../../generated/graphql'; interface Props { event: EventEntity; } const EventCard = ({event}: Props) => { const {t} = useTranslation(); const classes = useStyles(); return ( router.push(`/e/${event.attributes.uuid}`, undefined, {shallow: true}) } > {event.attributes.name} {t('event.fields.date')} {event.attributes.date || t('event.fields.empty')} {t('event.fields.address')} {event.attributes.address || t('event.fields.empty')} ); }; const useStyles = makeStyles({ clickable: { cursor: 'pointer', }, name: { whiteSpace: 'nowrap', textOverflow: 'ellipsis', overflow: 'hidden', }, }); export default EventCard;