diff --git a/src/components/wizard/OutputBlock.tsx b/src/components/wizard/OutputBlock.tsx new file mode 100644 index 0000000..c52bcd7 --- /dev/null +++ b/src/components/wizard/OutputBlock.tsx @@ -0,0 +1,53 @@ +// src/components/wizard/OutputBlock.tsx +// Reusable output block: pre-formatted content + copy button + optional download button. +// disabled prop gates both actions (SECU-01 security acknowledgement gate). +import { useState } from 'react'; +import { downloadFile } from '../../utils/downloadFile'; + +export interface OutputBlockProps { + label: string; + content: string; + filename?: string; + disabled?: boolean; +} + +export function OutputBlock({ label, content, filename, disabled = false }: OutputBlockProps) { + const [copied, setCopied] = useState(false); + + async function handleCopy() { + await navigator.clipboard.writeText(content); + setCopied(true); + setTimeout(() => setCopied(false), 2000); + } + + return ( +
+ {content}
+
+