mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-21 07:01:04 +08:00
### What problem does this PR solve? Fix: Remove the pagination from the search and retrieval pages. ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
39 lines
976 B
TypeScript
39 lines
976 B
TypeScript
import { useMemo } from 'react';
|
|
import { useTranslation } from 'react-i18next';
|
|
import { SelectWithSearch } from './originui/select-with-search';
|
|
import { RAGFlowFormItem } from './ragflow-form';
|
|
|
|
type TopSelectProps = {
|
|
value?: number;
|
|
onChange?(value: number): void;
|
|
};
|
|
|
|
export function TopSelect({ value = 10, onChange }: TopSelectProps) {
|
|
const { t } = useTranslation();
|
|
|
|
const sizeChangerOptions = useMemo(() => {
|
|
return [10, 20, 50, 100].map((x) => ({
|
|
label: <span>{t('common.top', { top: x })}</span>,
|
|
value: x.toString(),
|
|
}));
|
|
}, [t]);
|
|
|
|
return (
|
|
<SelectWithSearch
|
|
options={sizeChangerOptions}
|
|
value={value.toString()}
|
|
onChange={(val) => onChange?.(Number(val))}
|
|
></SelectWithSearch>
|
|
);
|
|
}
|
|
|
|
export function TopSelectFormItem() {
|
|
const { t } = useTranslation();
|
|
|
|
return (
|
|
<RAGFlowFormItem label={t('knowledgeConfiguration.top')} name="size">
|
|
<TopSelect></TopSelect>
|
|
</RAGFlowFormItem>
|
|
);
|
|
}
|