Skip to content

Commit b609255

Browse files
cjw6kclaude
andcommitted
fix: Remove duplicate print button from PrintReport
ExportMenu already has a Print button. PrintReport should only render the hidden print-only content, not a second button. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 7ee5f16 commit b609255

File tree

1 file changed

+5
-21
lines changed

1 file changed

+5
-21
lines changed

tidal-harmonics/src/components/ui/PrintReport.tsx

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1-
import { useMemo, useCallback } from 'react';
1+
import { useMemo } from 'react';
22
import { format } from 'date-fns';
33
import { useHarmonicsStore } from '@/stores/harmonicsStore';
44
import { useTimeStore } from '@/stores/timeStore';
55
import { predictTideSeries, findExtremes } from '@/lib/harmonics';
66

7+
/**
8+
* PrintReport - renders hidden content that appears only when printing.
9+
* The print button is in ExportMenu.tsx.
10+
*/
711
export function PrintReport() {
812
const station = useHarmonicsStore((s) => s.selectedStation);
913
const epoch = useTimeStore((s) => s.epoch);
@@ -37,30 +41,10 @@ export function PrintReport() {
3741
};
3842
}, [station, epoch]);
3943

40-
const handlePrint = useCallback(() => {
41-
window.print();
42-
}, []);
43-
4444
if (!station) return null;
4545

4646
return (
4747
<>
48-
<button
49-
onClick={handlePrint}
50-
className="p-2 rounded border bg-slate-700 border-slate-600 text-slate-400 hover:text-cyan-400 transition-colors focus:outline-none focus:ring-2 focus:ring-cyan-400"
51-
title="Print tide report"
52-
aria-label="Print tide report"
53-
>
54-
<svg className="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
55-
<path
56-
strokeLinecap="round"
57-
strokeLinejoin="round"
58-
strokeWidth={2}
59-
d="M17 17h2a2 2 0 002-2v-4a2 2 0 00-2-2H5a2 2 0 00-2 2v4a2 2 0 002 2h2m2 4h6a2 2 0 002-2v-4a2 2 0 00-2-2H9a2 2 0 00-2 2v4a2 2 0 002 2zm8-12V5a2 2 0 00-2-2H9a2 2 0 00-2 2v4h10z"
60-
/>
61-
</svg>
62-
</button>
63-
6448
{/* Print-only content */}
6549
<div className="hidden print:block print-report">
6650
<header className="print-header">

0 commit comments

Comments
 (0)