fix
This commit is contained in:
@@ -1,30 +1,9 @@
|
||||
import React, { ReactNode } from 'react';
|
||||
import SelectionFloatingActions from '../documents/SelectionFloatingActions';
|
||||
import { SelectionFloatingPanel } from '../documents/SelectionFloatingActions';
|
||||
import { createDocumentsTableHeaderActions } from '../documents/DocumentsPanel';
|
||||
import createWorkspaceSurfaceConfig from '../documents/workspaceHeader';
|
||||
import DocumentViewerPanel from '../preview/DocumentViewerPanel';
|
||||
import DesktopWorkspace from './DesktopWorkspace';
|
||||
import { useWorkspaceSelectionContext } from '../app/WorkspaceSelectionContext';
|
||||
|
||||
type SelectionFloatingActionsBaseProps = Omit<React.ComponentProps<typeof SelectionFloatingActions>, 'selectionCount' | 'selectedDocumentIds' | 'selectedFolderIds'>;
|
||||
|
||||
const SelectionFloatingActionsWithSelection: React.FC<SelectionFloatingActionsBaseProps> = (props) => {
|
||||
const { selectedDocumentIds, selectedFolderIds } = useWorkspaceSelectionContext();
|
||||
const documentIds = Array.isArray(selectedDocumentIds) ? selectedDocumentIds : [];
|
||||
const folderIds = Array.isArray(selectedFolderIds) ? selectedFolderIds : [];
|
||||
const selectionCount = documentIds.length + folderIds.length;
|
||||
if (selectionCount === 0) {
|
||||
return null;
|
||||
}
|
||||
return (
|
||||
<SelectionFloatingActions
|
||||
selectionCount={selectionCount}
|
||||
selectedDocumentIds={documentIds}
|
||||
selectedFolderIds={folderIds}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
type WorkspaceProps = Record<string, any>;
|
||||
|
||||
@@ -58,7 +37,6 @@ const createDesktopSurface = ({
|
||||
viewMode,
|
||||
onViewModeChange,
|
||||
onDeleteSelection,
|
||||
onClearSelection,
|
||||
tags,
|
||||
correspondents,
|
||||
documentLookup,
|
||||
@@ -88,7 +66,7 @@ const createDesktopSurface = ({
|
||||
});
|
||||
|
||||
const floatingActions = (
|
||||
<SelectionFloatingActionsWithSelection
|
||||
<SelectionFloatingPanel
|
||||
documentLookup={documentLookup}
|
||||
tags={tags}
|
||||
tagLookupById={tagLookupById}
|
||||
@@ -99,7 +77,6 @@ const createDesktopSurface = ({
|
||||
onBulkCorrespondentRemove={onBulkCorrespondentRemove}
|
||||
onBulkReanalyze={onBulkReanalyze}
|
||||
onDeleteSelection={onDeleteSelection}
|
||||
onClearSelection={onClearSelection}
|
||||
folderOptions={folderOptions}
|
||||
onMoveDocumentsToFolder={onMoveDocumentsToFolder}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user