import { useState } from "react";
import { Container, Popover, useMantineTheme } from "@mantine/core";
import type { CalendarEvent } from "@homarr/integrations/types";
import { CalendarEventList } from "./calendar-event-list";
interface CalendarDayProps {
date: Date;
events: CalendarEvent[];
disabled: boolean;
}
export const CalendarDay = ({ date, events, disabled }: CalendarDayProps) => {
const [opened, setOpend] = useState(false);
const { primaryColor } = useMantineTheme();
return (
{
if (disabled) return;
setOpend((prev) => !prev);
}}
>
{date.getDate()}
);
};
interface NotificationIndicatorProps {
events: CalendarEvent[];
}
const NotificationIndicator = ({ events }: NotificationIndicatorProps) => {
const notificationEvents = [...new Set(events.map((event) => event.links[0]?.notificationColor))].filter(String);
return (
{notificationEvents.map((notificationEvent) => {
return (
);
})}
);
};