// src/components/wizard/ReviewStep.tsx // Step 3 component — live preview + security gate + all download/copy actions. // Covers CONF-02, CONF-03, DOWN-01–DOWN-06, SECU-01, SECU-02. import { useMemo, useState } from 'react'; import { useWizard } from '../../store/context'; import { MD3_BTN_FILLED, MD3_BTN_OUTLINED } from '../../styles/md3-buttons'; import { buildRcloneConf, buildIntuneInstall, buildIntuneDetection, buildRmmScript, } from '../../generators/index'; import { OutputBlock } from './OutputBlock'; import { downloadZip } from '../../utils/downloadZip'; const PLACEHOLDER = '# Fill in the wizard steps to generate your rclone.conf'; export function ReviewStep() { const { state, dispatch } = useWizard(); const [acknowledged, setAcknowledged] = useState(false); // CONF-02: live preview — updates on every state change const rcloneConf = useMemo(() => { try { return buildRcloneConf(state); } catch { return PLACEHOLDER; } }, [state]); const intuneInstall = useMemo(() => { try { return buildIntuneInstall(state); } catch { return ''; } }, [state]); const intuneDetection = useMemo(() => { try { return buildIntuneDetection(state); } catch { return ''; } }, [state]); const rmmScript = useMemo(() => { try { return buildRmmScript(state); } catch { return ''; } }, [state]); const showIntune = state.deployment.scriptTargets.includes('intune'); const showRmm = state.deployment.scriptTargets.includes('rmm'); // DOWN-05: ZIP bundle — filtered by scriptTargets (TECH-01) async function handleDownloadZip() { const files: { name: string; content: string }[] = [ { name: 'rclone.conf', content: rcloneConf }, ]; if (showIntune) { files.push({ name: 'intune-install.ps1', content: intuneInstall }); files.push({ name: 'intune-detection.ps1', content: intuneDetection }); } if (showRmm) { files.push({ name: 'rmm-script.ps1', content: rmmScript }); } await downloadZip(files, 'rclone-deployment.zip'); } return (
Review your generated files and download them. Acknowledge the security notice before copying or downloading credentials.
{/* SECU-02: client-side only notice */}No data is sent to any server. All file generation happens in your browser.
{/* SECU-01: security acknowledgement gate */}Security warning: generated files contain credentials in plain text.