Add support for external selection state in ActionToolbar component

This commit is contained in:
2026-01-29 04:00:47 +00:00
parent 1d6e1ca196
commit 6cce9ba646

View File

@@ -36,6 +36,10 @@ const props = defineProps({
selectedFile: {
type: String,
default: ''
},
selectionState: {
type: Object,
default: null
}
});
@@ -43,6 +47,13 @@ const displayLines = toRef(props, 'displayLines');
const fileContent = toRef(props, 'fileContent');
const selectedFile = toRef(props, 'selectedFile');
const internalSelectionState = useLineSelection(
displayLines,
fileContent,
selectedFile
);
const activeSelectionState = props.selectionState || internalSelectionState;
const {
selectionCount,
copySelected,
@@ -50,7 +61,7 @@ const {
exportSelected,
exportAll,
shareUrl
} = useLineSelection(displayLines, fileContent, selectedFile);
} = activeSelectionState;
</script>
<style scoped>