import TopNItem from '@/components/top-n-item'; import { useTranslate } from '@/hooks/common-hooks'; import { DatePicker, DatePickerProps, Form, Select, Switch } from 'antd'; import dayjs from 'dayjs'; import { useCallback, useMemo } from 'react'; import { useBuildSortOptions } from '../form-hooks'; import { IOperatorForm } from '../interface'; const YearPicker = ({ onChange, value, }: { onChange?: (val: number | undefined) => void; value?: number | undefined; }) => { const handleChange: DatePickerProps['onChange'] = useCallback( (val: any) => { const nextVal = val?.format('YYYY'); onChange?.(nextVal ? Number(nextVal) : undefined); }, [onChange], ); // The year needs to be converted into a number and saved to the backend const nextValue = useMemo(() => { if (value) { return dayjs(value.toString()); } return undefined; }, [value]); return ; }; const GoogleScholarForm = ({ onValuesChange, form }: IOperatorForm) => { const { t } = useTranslate('flow'); const options = useBuildSortOptions(); return (
); }; export default GoogleScholarForm;