Open History to see the last commit
1import { useGameSoundPreference } from "../../lib/game-sounds"
2
3export function SoundButton() {
4 const { soundEnabled, toggleSound } = useGameSoundPreference()
5 return (
6 <button
7 className="zoom-button minimap-sound-button"
8 onClick={toggleSound}
9 aria-label={soundEnabled ? "Mute sounds" : "Enable sounds"}
10 aria-pressed={soundEnabled}
11 title={soundEnabled ? "Mute sounds" : "Enable sounds"}
12 >
13 <svg
14 width="18"
15 height="18"
16 viewBox="0 0 24 24"
17 fill="none"
18 stroke="currentColor"
19 strokeWidth="2"
20 strokeLinecap="round"
21 strokeLinejoin="round"
22 aria-hidden="true"
23 >
24 <path d="M11 5 6 9H3v6h3l5 4Z" />
25 {soundEnabled ? (
26 <>
27 <path d="M15 8a6 6 0 0 1 0 8" />
28 <path d="M18 5a10 10 0 0 1 0 14" />
29 </>
30 ) : (
31 <path d="m16 9 6 6m0-6-6 6" />
32 )}
33 </svg>
34 </button>
35 )
36}