function Calendar(props) {
    const { locale, selectionType, variant, value, onChange, ...rest } = props;
    const currentLocale = useLocale(locale);
    const currentValue = useCurrentDateFromValue(value);
    const range = useRangeFromValue(value, selectionType);

    const handleChange = useCallback(
        newValue => {
            if (selectionType === 'single') return onChange(newValue);
            const result = buildNewRangeFromValue(newValue, range);
            return onChange(result.range);
        },
        [selectionType, onChange, range],
    );

    if (variant === 'double')
        return (
            <DoubleCalendar
                locale={currentLocale}
                value={currentValue}
                selectedRange={range}
                selectionType={selectionType}
                onChange={handleChange}
                {...rest}
            />
        );

    return (
        <SingleCalendar
            locale={currentLocale}
            value={currentValue}
            selectedRange={range}
            selectionType={selectionType}
            onChange={handleChange}
            {...rest}
        />
    );
}
Calendar provide a simple way to select a single date.