refactor(quick-controls): 사운드 역할 분리와 패널 레이아웃·오버레이 개선

This commit is contained in:
2026-03-04 14:55:14 +09:00
parent 5c17bcf250
commit 8f64637b6f
4 changed files with 51 additions and 24 deletions

View File

@@ -0,0 +1,21 @@
import { PRO_LOCKED_SOUND_IDS } from '@/entities/plan';
import type { SoundPreset } from '@/entities/session';
const QUICK_SOUND_FALLBACK_IDS = ['rain-focus', 'deep-white', 'silent'] as const;
const isQuickAvailablePreset = (preset: SoundPreset | undefined): preset is SoundPreset => {
if (!preset) {
return false;
}
return !PRO_LOCKED_SOUND_IDS.includes(preset.id);
};
export const getQuickSoundPresets = (presets: SoundPreset[], selectedPresetId: string) => {
const uniquePresetIds = Array.from(new Set([selectedPresetId, ...QUICK_SOUND_FALLBACK_IDS]));
return uniquePresetIds
.map((presetId) => presets.find((preset) => preset.id === presetId))
.filter(isQuickAvailablePreset)
.slice(0, 3);
};