mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-02-06 18:45:08 +08:00
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:
@ -1,13 +1,6 @@
|
||||
import { ConfirmDeleteDialog } from '@/components/confirm-delete-dialog';
|
||||
import NewDocumentLink from '@/components/new-document-link';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import {
|
||||
DropdownMenu,
|
||||
DropdownMenuContent,
|
||||
DropdownMenuItem,
|
||||
DropdownMenuSeparator,
|
||||
DropdownMenuTrigger,
|
||||
} from '@/components/ui/dropdown-menu';
|
||||
import { useDownloadFile } from '@/hooks/file-manager-hooks';
|
||||
import { IFile } from '@/interfaces/database/file-manager';
|
||||
import {
|
||||
@ -15,9 +8,15 @@ import {
|
||||
isSupportedPreviewDocumentType,
|
||||
} from '@/utils/document-util';
|
||||
import { CellContext } from '@tanstack/react-table';
|
||||
import { EllipsisVertical, Eye, Link2, Trash2 } from 'lucide-react';
|
||||
import {
|
||||
ArrowDownToLine,
|
||||
Eye,
|
||||
FolderInput,
|
||||
FolderPen,
|
||||
Link2,
|
||||
Trash2,
|
||||
} from 'lucide-react';
|
||||
import { useCallback } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import {
|
||||
UseHandleConnectToKnowledgeReturnType,
|
||||
UseRenameCurrentFileReturnType,
|
||||
@ -36,7 +35,6 @@ export function ActionCell({
|
||||
showFileRenameModal,
|
||||
showMoveFileModal,
|
||||
}: IProps) {
|
||||
const { t } = useTranslation();
|
||||
const record = row.original;
|
||||
const documentId = record.id;
|
||||
const { downloadFile } = useDownloadFile();
|
||||
@ -63,33 +61,43 @@ export function ActionCell({
|
||||
}, [record, showMoveFileModal]);
|
||||
|
||||
return (
|
||||
<section className="flex gap-4 items-center">
|
||||
<section className="flex gap-4 items-center text-text-sub-title-invert">
|
||||
<Button
|
||||
variant="ghost"
|
||||
size={'icon'}
|
||||
size={'sm'}
|
||||
onClick={handleShowConnectToKnowledgeModal}
|
||||
>
|
||||
<Link2 />
|
||||
</Button>
|
||||
<ConfirmDeleteDialog>
|
||||
<Button variant="ghost" size={'icon'}>
|
||||
<Trash2 className="text-text-delete-red" />
|
||||
<Button variant="ghost" size={'sm'} onClick={handleShowMoveFileModal}>
|
||||
<FolderInput />
|
||||
</Button>
|
||||
|
||||
<Button variant="ghost" size={'sm'} onClick={handleShowFileRenameModal}>
|
||||
<FolderPen />
|
||||
</Button>
|
||||
|
||||
{isFolder || (
|
||||
<Button variant={'ghost'} size={'sm'} onClick={onDownloadDocument}>
|
||||
<ArrowDownToLine />
|
||||
</Button>
|
||||
</ConfirmDeleteDialog>
|
||||
)}
|
||||
|
||||
{isSupportedPreviewDocumentType(extension) && (
|
||||
<NewDocumentLink
|
||||
documentId={documentId}
|
||||
documentName={record.name}
|
||||
color="black"
|
||||
className="text-text-sub-title-invert"
|
||||
>
|
||||
<Button variant={'ghost'} size={'icon'}>
|
||||
<Button variant={'ghost'} size={'sm'}>
|
||||
<Eye />
|
||||
</Button>
|
||||
</NewDocumentLink>
|
||||
)}
|
||||
<DropdownMenu>
|
||||
|
||||
{/* <DropdownMenu>
|
||||
<DropdownMenuTrigger asChild>
|
||||
<Button variant="ghost" size={'icon'}>
|
||||
<Button variant="ghost" size={'sm'}>
|
||||
<EllipsisVertical />
|
||||
</Button>
|
||||
</DropdownMenuTrigger>
|
||||
@ -108,7 +116,12 @@ export function ActionCell({
|
||||
</DropdownMenuItem>
|
||||
)}
|
||||
</DropdownMenuContent>
|
||||
</DropdownMenu>
|
||||
</DropdownMenu> */}
|
||||
<ConfirmDeleteDialog>
|
||||
<Button variant="ghost" size={'sm'}>
|
||||
<Trash2 />
|
||||
</Button>
|
||||
</ConfirmDeleteDialog>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user