2024-06-05 10:46:06 +08:00
|
|
|
import { useTranslate } from '@/hooks/commonHooks';
|
|
|
|
|
import { Form, Slider } from 'antd';
|
|
|
|
|
|
|
|
|
|
type FieldType = {
|
|
|
|
|
top_n?: number;
|
|
|
|
|
};
|
|
|
|
|
|
2024-07-12 17:22:01 +08:00
|
|
|
interface IProps {
|
|
|
|
|
initialValue?: number;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const TopNItem = ({ initialValue = 8 }: IProps) => {
|
2024-06-05 10:46:06 +08:00
|
|
|
const { t } = useTranslate('chat');
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<Form.Item<FieldType>
|
|
|
|
|
label={t('topN')}
|
|
|
|
|
name={'top_n'}
|
2024-07-12 17:22:01 +08:00
|
|
|
initialValue={initialValue}
|
2024-06-05 10:46:06 +08:00
|
|
|
tooltip={t('topNTip')}
|
|
|
|
|
>
|
|
|
|
|
<Slider max={30} />
|
|
|
|
|
</Form.Item>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default TopNItem;
|