This commit is contained in:
2025-11-24 20:19:44 +01:00
parent 66848e8526
commit 4c8ff39305
10 changed files with 130 additions and 109 deletions
+4 -4
View File
@@ -14,7 +14,7 @@ interface WorkspaceSelectionOptions {
isDocumentRowKey?: (key: RowKey | SelectionEntry) => boolean;
isFolderRowKey?: (key: RowKey | SelectionEntry) => boolean;
getRowId?: (key: RowKey | SelectionEntry) => string | number | null;
onInspectDocument?: (id: string | number) => void;
onDocumentActivate?: (id: string | number) => void;
onInspectFolder?: (id: string | number) => void;
}
@@ -26,7 +26,7 @@ export const useWorkspaceSelection = ({
isDocumentRowKey = () => false,
isFolderRowKey = () => false,
getRowId = () => null,
onInspectDocument = identity,
onDocumentActivate = identity,
onInspectFolder = identity,
}: WorkspaceSelectionOptions = {}) => {
const selection = useDocumentSelection({
@@ -88,9 +88,9 @@ export const useWorkspaceSelection = ({
const inspectDocument = useCallback(
(documentId?: string | number | null) => {
if (!documentId) return;
onInspectDocument(documentId);
onDocumentActivate(documentId);
},
[onInspectDocument],
[onDocumentActivate],
);
const inspectFolder = useCallback(