import DatePanel from '../DatePanel'; import type { PanelSharedProps } from '../../interface'; import { isSameWeek } from '../../utils/dateUtil'; import classNames from '../../../_util/classNames'; import useMergeProps from '../../hooks/useMergeProps'; export type WeekPanelProps = PanelSharedProps; function WeekPanel(_props: WeekPanelProps) { const props = useMergeProps(_props); const { prefixCls, generateConfig, locale, value } = props; // Render additional column const cellPrefixCls = `${prefixCls}-cell`; const prefixColumn = (date: DateType) => ( {generateConfig.locale.getWeek(locale.locale, date)} ); // Add row className const rowPrefixCls = `${prefixCls}-week-panel-row`; const rowClassName = (date: DateType) => classNames(rowPrefixCls, { [`${rowPrefixCls}-selected`]: isSameWeek(generateConfig, locale.locale, value, date), }); return ( ); } WeekPanel.displayName = 'WeekPanel'; WeekPanel.inheritAttrs = false; export default WeekPanel;