import { useEffect } from 'react'; import type { BuildResponse } from '../../types'; import { useModalAmbientDuck } from '../../context/AmbientMusicContext'; import { useSound } from '../../context/SoundContext'; import DownloadButton from '../DownloadButton'; import './ForgeDispenseReveal.css'; interface Props { result: BuildResponse; onClose: () => void; } function dnaBars(fingerprint?: string): number[] { const raw = fingerprint || 'aetherforge'; const bars: number[] = []; for (let i = 0; i < 24; i++) { const c = raw.charCodeAt(i % raw.length); bars.push(12 + ((c * (i + 3)) % 88)); } return bars; } export default function ForgeDispenseReveal({ result, onClose }: Props) { useModalAmbientDuck(true); const { play } = useSound(); const score = result.stealth_score ?? 0; const bars = dnaBars(result.binary_fingerprint); useEffect(() => { play('success'); }, [play]); return (
{result.file_name || 'Your worker'} is ready — each forge carries a unique binary signature.
{result.binary_fingerprint}