From 5178e2a4fc62d0e7fc3408062d5eccfe94a7b581 Mon Sep 17 00:00:00 2001 From: Leopoldadmin Date: Mon, 22 Jun 2026 23:21:08 +0000 Subject: [PATCH] T21: Add Print button and PrintPreview modal to RibbonBar.tsx --- frontend/src/components/RibbonBar.tsx | 48 ++++++++++++++------------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/frontend/src/components/RibbonBar.tsx b/frontend/src/components/RibbonBar.tsx index 41947e0..a928b9c 100644 --- a/frontend/src/components/RibbonBar.tsx +++ b/frontend/src/components/RibbonBar.tsx @@ -2,6 +2,7 @@ import React, { useState, useRef, useCallback } from 'react'; import type { YjsDocument } from '../crdt/YjsDocument'; import { exportDrawing, type ExportFormat } from '../services/exportService'; import { importDrawing, type ImportFormat, type ImportResult } from '../services/importService'; +import PrintPreview from './PrintPreview/PrintPreview'; import './RibbonBar.css'; interface RibbonBarProps { @@ -14,6 +15,7 @@ const RibbonBar: React.FC = ({ onTabChange, yjsDoc }) => { const [showExportMenu, setShowExportMenu] = useState(false); const [showImportMenu, setShowImportMenu] = useState(false); const [importStatus, setImportStatus] = useState(null); + const [showPrintPreview, setShowPrintPreview] = useState(false); const fileInputRef = useRef(null); const pendingImportFormat = useRef('json'); @@ -75,7 +77,6 @@ const RibbonBar: React.FC = ({ onTabChange, yjsDoc }) => { setImportStatus(`Import error: ${(err as Error).message}`); } setTimeout(() => setImportStatus(null), 5000); - // Reset input so same file can be selected again if (fileInputRef.current) { fileInputRef.current.value = ''; } @@ -96,7 +97,6 @@ const RibbonBar: React.FC = ({ onTabChange, yjsDoc }) => { ))} - {/* Export/Import section */} + ); };