/** * @file Milestone toast notification component for prestige, transcendence, and apotheosis. * @copyright nhcarrigan * @license Naomi's Public License * @author Naomi Carrigan */ /* eslint-disable react/no-multi-comp -- Sub-components are tightly coupled to their containers */ import { type JSX, useEffect } from "react"; import { useGame } from "../../context/gameContext.js"; interface MilestoneToastItemProperties { readonly icon: string; readonly label: string; readonly onDismiss: ()=> void; } /** * Renders a single milestone toast notification. * @param props - The toast item properties. * @param props.icon - The emoji icon. * @param props.label - The label text. * @param props.onDismiss - Callback to dismiss the toast. * @returns The JSX element. */ const MilestoneToastItem = ({ icon, label, onDismiss, }: MilestoneToastItemProperties): JSX.Element => { useEffect(() => { const timer = setTimeout(() => { onDismiss(); }, 4000); return (): void => { clearTimeout(timer); }; }, [ onDismiss ]); return (