ragflow/web/src/pages/datasets/use-select-owners.ts
balibabu bdebd1b2e3
Feat: Filter document by running status and file type. #3221 (#7340)
### What problem does this PR solve?
Feat: Filter document by running status and file type. #3221

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
2025-04-27 14:39:05 +08:00

18 lines
538 B
TypeScript

import { FilterCollection } from '@/components/list-filter-bar/interface';
import { useFetchKnowledgeList } from '@/hooks/knowledge-hooks';
import { groupListByType } from '@/utils/dataset-util';
import { useMemo } from 'react';
export function useSelectOwners() {
const { list } = useFetchKnowledgeList();
const owners = useMemo(() => {
return groupListByType(list, 'tenant_id', 'nickname');
}, [list]);
const filters: FilterCollection[] = [
{ field: 'owner', list: owners, label: 'Owner' },
];
return filters;
}