open as worspace implementation
This commit is contained in:
@@ -12,6 +12,7 @@ interface ActionsPanelProps {
|
||||
|
||||
onSplit: () => void;
|
||||
onExtractSelected: () => void;
|
||||
onOpenSelectionAsWorkspace: () => void;
|
||||
onExportReordered: () => void;
|
||||
|
||||
splitDownloads: SplitPdfDownload[];
|
||||
@@ -25,6 +26,7 @@ const ActionsPanel: React.FC<ActionsPanelProps> = ({
|
||||
selectedCount,
|
||||
onSplit,
|
||||
onExtractSelected,
|
||||
onOpenSelectionAsWorkspace,
|
||||
onExportReordered,
|
||||
splitDownloads,
|
||||
subsetDownload,
|
||||
@@ -37,6 +39,11 @@ const ActionsPanel: React.FC<ActionsPanelProps> = ({
|
||||
onExtractSelected();
|
||||
};
|
||||
|
||||
const handleOpenSelectionAsWorkspaceClick = () => {
|
||||
if (selectedCount === 0) return;
|
||||
onOpenSelectionAsWorkspace();
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="card">
|
||||
<h2>Tools</h2>
|
||||
@@ -72,6 +79,20 @@ const ActionsPanel: React.FC<ActionsPanelProps> = ({
|
||||
📤 Extract selected ({selectedCount})
|
||||
</button>
|
||||
|
||||
<button
|
||||
className="secondary"
|
||||
disabled={disabled || selectedCount === 0}
|
||||
onClick={handleOpenSelectionAsWorkspaceClick}
|
||||
style={{ flex: '1 1 45%' }}
|
||||
title={
|
||||
selectedCount === 0
|
||||
? 'Select at least one page'
|
||||
: 'Open selected pages as a new unsaved workspace'
|
||||
}
|
||||
>
|
||||
🧩 Open selection as workspace
|
||||
</button>
|
||||
|
||||
<button
|
||||
className="secondary"
|
||||
disabled={disabled}
|
||||
|
||||
Reference in New Issue
Block a user