import { __assign, __rest } from "tslib";
import { jsx as _jsx } from "react/jsx-runtime";
import { useContext, useMemo } from 'react';
import DatePickerPanel from '../date-panel';
import useWeekRange from '../../hooks/useWeekRange';
import PickerContext from '../../context/PickerContext';
var WeekPickerPanel = function (_a) {
    var selected = _a.selected, hoverDate = _a.hoverDate, weekStartsOn = _a.weekStartsOn, restProps = __rest(_a, ["selected", "hoverDate", "weekStartsOn"]);
    var _b = useContext(PickerContext), generateDate = _b.generateDate, i18n = _b.i18n;
    var options = useMemo(function () { return ({ weekStartsOn: weekStartsOn }); }, [weekStartsOn]);
    var hoverRangeDate = useWeekRange(generateDate, hoverDate, options);
    var rangeDate = useWeekRange(generateDate, selected, options);
    return (_jsx(DatePickerPanel, __assign({}, restProps, { footerText: i18n.current.week, selected: selected, rangeDate: rangeDate, hoverRangeDate: hoverRangeDate }), void 0));
};
export default WeekPickerPanel;
