import { CampfireIcon, FlameIcon, XCircleIcon } from "@phosphor-icons/react"; import { useEffect, useState } from "react"; interface BurnModalProps { burnLetter: () => void; isBurning: boolean; setShowBurnModal: (show: boolean) => void; setRevealState: (state: "sealed" | "revealed" | "burning" | "burned") => void; } export function BurnModal({ burnLetter, isBurning, setShowBurnModal, setRevealState, }: BurnModalProps) { const [flameOn, setFlameOn] = useState(0); const [rotate, setRotate] = useState(0); const [burnClicked, setBurnClicked] = useState(false); useEffect(() => { if (!burnClicked) return; if (flameOn === 100) { setRevealState("sealed"); burnLetter(); } const interval = setInterval(() => { setFlameOn((prev) => prev + 1); setRotate(Math.random() * 4 - 2); }, 100); return () => clearInterval(interval); }, [burnClicked, flameOn, setRevealState, burnLetter]); const burnStyle = flameOn < 30 ? "" : `contrast(${flameOn / 30})`; return (
Some words are meant to be unsaid, but they don't have to linger
forever.
Let the echoes of your unsaid be finally released.