Feat: Adjust the operation cell of the table on the file management page and dataset page #3221. (#7526)

### What problem does this PR solve?

Feat: Adjust the operation cell of the table on the file management page
and dataset page #3221.
### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2025-05-08 15:25:26 +08:00
committed by GitHub
parent 9d3dd13fef
commit 1657755b5d
18 changed files with 163 additions and 115 deletions

View File

@ -7,12 +7,13 @@ import {
HoverCardTrigger,
} from '@/components/ui/hover-card';
import { IFile } from '@/interfaces/database/file-manager';
import { Ellipsis } from 'lucide-react';
import { useCallback } from 'react';
export function KnowledgeCell({ value }: { value: IFile['kbs_info'] }) {
const renderBadges = useCallback((list: IFile['kbs_info'] = []) => {
return list.map((x) => (
<Badge key={x.kb_id} className="" variant={'tertiary'}>
<Badge key={x.kb_id} variant={'secondary'}>
{x.kb_name}
</Badge>
));
@ -25,8 +26,8 @@ export function KnowledgeCell({ value }: { value: IFile['kbs_info'] }) {
{value.length > 2 && (
<HoverCard>
<HoverCardTrigger>
<Button variant={'icon'} size={'auto'}>
+{value.length - 2}
<Button variant={'ghost'} size={'sm'}>
<Ellipsis />
</Button>
</HoverCardTrigger>
<HoverCardContent className="flex gap-2 flex-wrap">