import { h } from 'preact' import { format } from 'date-fns' import Link from '../Link' import { H2, H3, Label } from '../Text' import strings from '../../data/strings' import { andList } from '../../helpers/string' import { colours } from '../../assets/theme' import { Img, Left, Right, Center, Title, Row, Column, StyledButton as Button } from './styles' import { useEventApi } from '../../hooks/data' const EpisodeCard = ({ image, title, seriesId, beginsOn, id, ...rest }) => { const { data: { series: allSeries } } = useEventApi() const series = seriesId ? allSeries.filter(({ id }) => id === seriesId)[0] : {} const hosts = series.hosts ? series.hosts.map(host => host.actor.name) : null const startTime = format(new Date(beginsOn), 'ha') return (
{title}

From: {`${series.title}: ${series.subtitle}`}

{hosts ? : null}
) } export default EpisodeCard