mirror of
https://github.com/kilyabin/psysonic.git
synced 2026-07-22 22:45:41 +00:00
306e56dc2b
Pull pure helpers, the contributors/maintainers data list and the tab type/search index out of `Settings.tsx` so the main component only has tab-section render logic + the orchestrating state left: - `utils/audioDeviceLabels.ts` — five ALSA-device label helpers (formatAudioDeviceLabel + duplicate-disambiguation + sort + select-option builder). - `utils/formatBytes.ts` — formatBytes + snapHotCacheMb. - `components/settings/LoudnessLufsButtonGroup.tsx` — small chip group used by the audio tab. - `components/settings/settingsTabs.ts` — `Tab` type + legacy alias map + `resolveTab` + `SearchIndexEntry` + `SETTINGS_INDEX` + the `matchScore` substring-with-fuzzy-fallback scorer. - `config/settingsCredits.ts` — `CONTRIBUTORS` (~270 LOC of static contributor history) + `MAINTAINERS`. Pure code-move. Settings.tsx: 3552 → 3037 LOC (−515). Settings/G journey now 5298 → 3037 LOC (~43% reduction).
25 lines
736 B
TypeScript
25 lines
736 B
TypeScript
import type { LoudnessLufsPreset } from '../../store/authStoreTypes';
|
|
|
|
const LOUDNESS_LUFS_BUTTON_ORDER: LoudnessLufsPreset[] = [-10, -12, -14, -16];
|
|
|
|
export function LoudnessLufsButtonGroup(props: {
|
|
value: LoudnessLufsPreset;
|
|
onSelect: (v: LoudnessLufsPreset) => void;
|
|
}) {
|
|
return (
|
|
<div style={{ display: 'flex', alignItems: 'center', gap: '0.35rem', flexWrap: 'wrap' }}>
|
|
{LOUDNESS_LUFS_BUTTON_ORDER.map(v => (
|
|
<button
|
|
key={v}
|
|
type="button"
|
|
className={`btn ${props.value === v ? 'btn-primary' : 'btn-ghost'}`}
|
|
style={{ fontSize: 12, padding: '3px 12px' }}
|
|
onClick={() => props.onSelect(v)}
|
|
>
|
|
{v}
|
|
</button>
|
|
))}
|
|
</div>
|
|
);
|
|
}
|