Files
Webklar.com/node_modules/react-day-picker/src/components/DayContent/DayContent.tsx
Basilosaurusrex f027651f9b main repo
2025-11-24 18:09:40 +01:00

23 lines
652 B
TypeScript

import { useDayPicker } from 'contexts/DayPicker';
import { ActiveModifiers } from 'types/Modifiers';
/** Represent the props for the {@link DayContent} component. */
export interface DayContentProps {
/** The date representing the day. */
date: Date;
/** The month where the day is displayed. */
displayMonth: Date;
/** The active modifiers for the given date. */
activeModifiers: ActiveModifiers;
}
/** Render the content of the day cell. */
export function DayContent(props: DayContentProps): JSX.Element {
const {
locale,
formatters: { formatDay }
} = useDayPicker();
return <>{formatDay(props.date, { locale })}</>;
}