Feat: Create a folder #3221 (#7228)

### What problem does this PR solve?

Feat: Create a folder #3221

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2025-04-23 15:21:09 +08:00
committed by GitHub
parent 94181a990b
commit 51d9bde5a3
20 changed files with 626 additions and 133 deletions

View File

@ -17,15 +17,18 @@ import {
UseHandleConnectToKnowledgeReturnType,
UseRenameCurrentFileReturnType,
} from './hooks';
import { UseMoveDocumentReturnType } from './use-move-file';
type IProps = Pick<CellContext<IFile, unknown>, 'row'> &
Pick<UseHandleConnectToKnowledgeReturnType, 'showConnectToKnowledgeModal'> &
Pick<UseRenameCurrentFileReturnType, 'showFileRenameModal'>;
Pick<UseRenameCurrentFileReturnType, 'showFileRenameModal'> &
Pick<UseMoveDocumentReturnType, 'showMoveFileModal'>;
export function ActionCell({
row,
showConnectToKnowledgeModal,
showFileRenameModal,
showMoveFileModal,
}: IProps) {
const { t } = useTranslation();
const record = row.original;
@ -47,6 +50,10 @@ export function ActionCell({
showFileRenameModal(record);
}, [record, showFileRenameModal]);
const handleShowMoveFileModal = useCallback(() => {
showMoveFileModal([record.id]);
}, [record, showMoveFileModal]);
return (
<section className="flex gap-4 items-center">
<Button
@ -68,9 +75,7 @@ export function ActionCell({
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
<DropdownMenuItem
onClick={() => navigator.clipboard.writeText(record.id)}
>
<DropdownMenuItem onClick={handleShowMoveFileModal}>
{t('common.move')}
</DropdownMenuItem>
<DropdownMenuSeparator />