import authors from 'lib/authors.json' import Link from 'next/link' import React from 'react' import type Author from '~/types/author' import type PostTypes from '~/types/post' import dayjs from 'dayjs' import utc from 'dayjs/plugin/utc' import timezone from 'dayjs/plugin/timezone' import advancedFormat from 'dayjs/plugin/advancedFormat' import { Badge } from 'ui' dayjs.extend(utc) dayjs.extend(timezone) dayjs.extend(advancedFormat) interface Props { event: PostTypes } const EventListItem = ({ event }: Props) => { const authorArray: string[] | undefined = event?.author ? event.author.split(',') : [] const author = [] if (authorArray) { for (let i = 0; i < authorArray.length; i++) { author.push( authors.find((authors: Author) => { return authors.author_id === authorArray[i] }) ) } } return (
{formattedDate} {parsedDate.tz(event.timezone).format(' z')}
) } export default EventListItem