import { FC } from "react" import ControlButton from "../input/ControlButton" import InputSlider from "../input/InputSlider" import IconSoundMute from "../icon/IconSoundMute" import IconSoundDown from "../icon/IconSoundDown" import IconSoundOff from "../icon/IconSoundOff" import IconSoundUp from "../icon/IconSoundUp" interface Props { muted: boolean setMuted: (muted: boolean) => void volume: number setVolume: (volume: number) => void interaction: (touch: boolean | null) => void } const VolumeControl: FC = ({ muted, setMuted, volume, setVolume, interaction, }) => { let sound if (muted) { sound = } else if (volume < 0.3) { sound = } else if (volume < 0.7) { sound = } else { sound = } return (
{ setMuted(!muted) }} interaction={interaction} > {sound} { if (muted) { setMuted(false) } setVolume(newVolume) interaction(null) }} className={"hide-below-sm"} />
) } export default VolumeControl