import { Badge, Box, Button, darken, Group, Image, lighten, ScrollArea, Stack, Text, useMantineColorScheme, } from "@mantine/core"; import { IconClock } from "@tabler/icons-react"; import dayjs from "dayjs"; import type { CalendarEvent } from "@homarr/integrations/types"; import { useI18n } from "@homarr/translation/client"; import classes from "./calendar-event-list.module.css"; interface CalendarEventListProps { events: CalendarEvent[]; } export const CalendarEventList = ({ events }: CalendarEventListProps) => { const { colorScheme } = useMantineColorScheme(); const t = useI18n(); return ( {events.map((event, eventIndex) => ( {event.mediaInformation?.type === "tv" && ( {`S${event.mediaInformation.seasonNumber} / E${event.mediaInformation.episodeNumber}`} )} {event.subName && ( {event.subName} )} {event.name} {event.dates ? ( {t( `widget.calendar.option.releaseType.options.${event.dates.find(({ date }) => event.date === date)?.type ?? "inCinemas"}`, )} ) : ( {dayjs(event.date).format("HH:mm")} )} {event.description && ( {event.description} )} {event.links.length > 0 && ( {event.links.map((link) => ( ))} )} ))} ); };