ui: move audio volume control to top player bar
All checks were successful
CI / test (push) Successful in 29s

This commit is contained in:
2026-03-08 12:42:07 +03:00
parent 30169a3a27
commit d7160af908
2 changed files with 12 additions and 19 deletions

View File

@@ -31,6 +31,7 @@ export function ChatsPage() {
const activeTrack = useAudioPlayerStore((s) => s.track);
const isAudioPlaying = useAudioPlayerStore((s) => s.isPlaying);
const audioVolume = useAudioPlayerStore((s) => s.volume);
const setAudioVolume = useAudioPlayerStore((s) => s.setVolume);
const toggleAudioPlay = useAudioPlayerStore((s) => s.togglePlay);
const stopAudio = useAudioPlayerStore((s) => s.stop);
const audioEl = useAudioPlayerStore((s) => s.audioEl);
@@ -243,7 +244,17 @@ export function ChatsPage() {
<button className="rounded bg-slate-700/70 px-2 py-1" onClick={() => { if (audioEl && audioEl.duration) audioEl.currentTime = Math.min(audioEl.duration, audioEl.currentTime + 10); }} type="button">
</button>
<span className="text-[11px] text-slate-400">🔊 {Math.round(audioVolume * 100)}%</span>
<span className="text-[11px] text-slate-300">🔊</span>
<input
className="h-1.5 w-20 cursor-pointer accent-sky-300"
max={1}
min={0}
onChange={(event) => setAudioVolume(Number(event.target.value))}
step={0.05}
type="range"
value={audioVolume}
/>
<span className="w-9 text-right text-[11px] text-slate-400">{Math.round(audioVolume * 100)}%</span>
<button className="rounded bg-slate-700/70 px-2 py-1" onClick={stopAudio} type="button">
</button>