import type { FC } from 'react'; import React from 'react'; import type { Dayjs } from 'dayjs'; import { createStyles, css } from 'antd-style'; import classNames from 'classnames'; import { DatePicker } from 'antd'; const { _InternalPanelDoNotUseOrYouWillBeFired: PureDatePicker } = DatePicker; const useStyle = createStyles(({ token }) => ({ weekendCell: css` color: #ff4d4f40; .ant-picker-cell-in-view & { color: #ff4d4f; } `, detailedCell: css` width: 40px; height: 40px !important; `, detailedPicker: css` .ant-picker-date-panel { width: auto; .ant-picker-content { width: auto; } } `, extraInfo: css` font-size: 12px; line-height: 12px; transform: scale(${10 / 12}); color: ${token.colorTextQuaternary}; .ant-picker-cell-in-view & { color: ${token.colorTextSecondary}; } .ant-picker-cell-selected & { color: #fff; } `, add: css` color: #ff4d4f80; .ant-picker-cell-in-view & { color: #ff4d4f; } .ant-picker-cell-selected & { color: #fff; } `, minus: css` color: #52C41A80; .ant-picker-cell-in-view & { color: #52C41A; } .ant-picker-cell-selected & { color: #fff; } `, })); const seeds = Array(30) .fill(1) .map(() => Math.random()); const getSales = (date: Dayjs) => Math.floor(seeds[date.date() % 30] * 10000); const getData = (date: Dayjs) => (Math.floor(seeds[date.date() % 30] * 10000) - 5000) / 5000; const Demo: FC = () => { const { styles } = useStyle(); const dateRender = (current: Dayjs) => (