import { Box, Indicator, IndicatorProps, Popover } from '@mantine/core'; import { useDisclosure } from '@mantine/hooks'; import { MediaList } from './MediaList'; import { getBgColorByDateAndTheme } from './bg-calculator'; import { MediasType } from './type'; interface CalendarDayProps { date: Date; medias: MediasType; } export const CalendarDay = ({ date, medias }: CalendarDayProps) => { const [opened, { close, open }] = useDisclosure(false); if (medias.totalCount === 0) { return
{date.getDate()}
; } return ( ({ margin: 5, backgroundColor: getBgColorByDateAndTheme(theme.colorScheme, date), })} w="100%" >
{date.getDate()}
); }; interface DayIndicatorProps { color: string; medias: any[]; children: JSX.Element; position: IndicatorProps['position']; } const DayIndicator = ({ color, medias, children, position }: DayIndicatorProps) => { if (medias.length === 0) return children; return ( {children} ); };