import { useState } from "react"; import { useTranslation } from "next-i18next"; import { DateTime } from "luxon"; import classNames from "classnames"; import { IoMdCheckmarkCircleOutline } from "react-icons/io"; export default function Event({ event, colorVariants, showDate = false, showTime = false, showDateColumn = true }) { const [hover, setHover] = useState(false); const { i18n } = useTranslation(); return (
setHover(!hover)} onMouseLeave={() => setHover(!hover)} key={`event-${event.title}-${event.date}-${event.additional}`} > {showDateColumn && ( {(showDate || showTime) && event.date .setLocale(i18n.language) .toLocaleString(showTime ? DateTime.TIME_24_SIMPLE : { month: "short", day: "numeric" })} )}
{hover && event.additional ? event.additional : event.title}
{event.isCompleted && ( )}
); }