/* global React, Icon, IconBtn, Avatar, Kbd, Pill, Badge, Popover, PopoverItem */ /* App shell: StatusStrip, Sidebar, TopBar, CommandPalette */ const { useState, useEffect, useRef, useMemo } = React; function StatusStrip() { const [p, setP] = useState(8); useEffect(() => { const onScroll = () => { const h = document.documentElement; const max = h.scrollHeight - h.clientHeight; setP(Math.max(2, Math.min(100, (h.scrollTop / Math.max(1, max)) * 100))); }; window.addEventListener("scroll", onScroll, true); onScroll(); return () => window.removeEventListener("scroll", onScroll, true); }, []); return