ragflow/web/src/pages/datasets/use-display-owner.ts
balibabu ba0e363d5a
Feat: Show the owner of this knowledge base on the list card. #3221 (#7204)
### What problem does this PR solve?

Feat: Show the owner of this knowledge base on the list card. #3221

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
2025-04-22 16:46:13 +08:00

17 lines
419 B
TypeScript

import { useFetchTenantInfo } from '@/hooks/user-setting-hooks';
import { useCallback } from 'react';
export function useDisplayOwnerName() {
const { data } = useFetchTenantInfo();
const getOwnerName = useCallback(
(tenantId: string, nickname: string) => {
if (tenantId === data.tenant_id) {
return null;
}
return nickname;
},
[data.tenant_id],
);
return getOwnerName;
}