import { useLayoutEffect, useRef, useState } from "react" import Download, { PLATFORM_NAMES, SHORTCUTS } from "./Download" import { guessPlatform, refinePlatform, type Platform } from "./platform" import { OptionKey, SoundToggle, useShout } from "./Shout" import signature from "./footer-signature.svg" function HexMark() { return ( ) } function GitHubMark() { return ( ) } export default function App() { // The prerendered HTML is the Mac page; switch before the first paint, then // refine with client hints. const [platform, setPlatform] = useState("mac") useLayoutEffect(() => { let current = true const guess = guessPlatform() setPlatform(guess) void refinePlatform(guess).then((refined) => { if (current && refined !== guess) setPlatform(refined) }) return () => { current = false } }, []) const root = useRef(null) const canvas = useRef(null) const head = useRef(null) const shout = useShout(root, canvas, head) return ( <>
) }