'use client'; import * as React from 'react'; import Avatar from '@mui/material/Avatar'; import Box from '@mui/material/Box'; import Button from '@mui/material/Button'; import Card from '@mui/material/Card'; import CardActions from '@mui/material/CardActions'; import CardContent from '@mui/material/CardContent'; import CardHeader from '@mui/material/CardHeader'; import Divider from '@mui/material/Divider'; import IconButton from '@mui/material/IconButton'; import List from '@mui/material/List'; import ListItem from '@mui/material/ListItem'; import ListItemAvatar from '@mui/material/ListItemAvatar'; import ListItemText from '@mui/material/ListItemText'; import Typography from '@mui/material/Typography'; import { ArrowRight as ArrowRightIcon } from '@phosphor-icons/react/dist/ssr/ArrowRight'; import { CalendarBlank as CalendarBlankIcon } from '@phosphor-icons/react/dist/ssr/CalendarBlank'; import { DotsThree as DotsThreeIcon } from '@phosphor-icons/react/dist/ssr/DotsThree'; import { useTranslation } from 'react-i18next'; import { dayjs } from '@/lib/dayjs'; export interface Event { id: string; title: string; description: string; createdAt: Date; } export function Events({ events }: EventsProps): React.JSX.Element { const { t } = useTranslation(); return ( } avatar={ } subheader={t('Based on the linked bank accounts')} title={t('Upcoming events')} /> {events.map((event) => ( ))} ); } export interface EventItemProps { event: Event; } function EventItem({ event }: EventItemProps): React.JSX.Element { const { t } = useTranslation(); return ( {dayjs(event.createdAt).format('MMM').toUpperCase()} {dayjs(event.createdAt).format('D')} {t(event.title)} } secondary={ {t(event.description)} } /> ); } export interface EventsProps { events: Event[]; }