import { useState } from 'react' import { useSnapshot } from 'valtio' import { hideCurrentModal } from '../globalState' import { lastPlayedSounds } from '../soundSystem' import { options } from '../optionsStorage' import Button from './Button' import Screen from './Screen' import { useIsModalActive } from './utils' const SoundRow = ({ sound, children }) => { const { mutedSounds } = useSnapshot(options) const isMuted = mutedSounds.includes(sound) return
{sound} {children}
} export default () => { const isModalActive = useIsModalActive('sound-muffler') const [showMuted, setShowMuted] = useState(true) const [i, setI] = useState(0) const { mutedSounds } = useSnapshot(options) if (!isModalActive) return null return
Last World Played {Object.entries(lastPlayedSounds.lastServerPlayed).map(([key, value]) => { if (!showMuted && mutedSounds.includes(key)) return null as never return [key, value.count] as const }).filter(Boolean).sort((a, b) => b[1] - a[1]).slice(0, 20).map(([key, count]) => { return {count} })} Last Client Played {lastPlayedSounds.lastClientPlayed.map((key) => { if (!showMuted && mutedSounds.includes(key)) return null as never return })}
}