import { useRef } from 'react' import { Printer } from 'lucide-react' import Modal from '../shared/Modal' import { useTranslation } from '../../i18n' interface PackingPrintPreviewProps { /** The page to print; the preview is closed while this is null. */ html: string | null title: string onClose: () => void } /** * The printable packing list, shown before it goes to the printer (#1420). * * Printed from its own frame, so the page that reaches the printer is the list and * nothing of the planner around it, and "Save as PDF" in the browser's print dialog * is the PDF export. No script runs inside the frame; printing is started from here. */ export default function PackingPrintPreview({ html, title, onClose }: PackingPrintPreviewProps) { const { t } = useTranslation() const frameRef = useRef(null) return ( )} > {html != null && (