2023-09-22 00:06:13 +00:00
|
|
|
import { lazy, Suspense, useMemo } from 'react';
|
2023-03-30 06:44:33 -07:00
|
|
|
import { Divider, Stack } from '@mantine/core';
|
|
|
|
|
import { AudioSettings } from '/@/renderer/features/settings/components/playback/audio-settings';
|
|
|
|
|
import { ScrobbleSettings } from '/@/renderer/features/settings/components/playback/scrobble-settings';
|
2023-04-02 21:41:32 -07:00
|
|
|
import isElectron from 'is-electron';
|
2023-05-28 14:31:49 -07:00
|
|
|
import { LyricSettings } from '/@/renderer/features/settings/components/playback/lyric-settings';
|
2023-04-02 21:41:32 -07:00
|
|
|
|
|
|
|
|
const MpvSettings = lazy(() =>
|
2023-07-01 19:10:05 -07:00
|
|
|
import('/@/renderer/features/settings/components/playback/mpv-settings').then((module) => {
|
|
|
|
|
return { default: module.MpvSettings };
|
|
|
|
|
}),
|
2023-04-02 21:41:32 -07:00
|
|
|
);
|
2022-12-19 15:59:14 -08:00
|
|
|
|
|
|
|
|
export const PlaybackTab = () => {
|
2023-09-22 00:06:13 +00:00
|
|
|
const hasFancyAudio = useMemo(() => {
|
|
|
|
|
return isElectron() || 'AudioContext' in window;
|
|
|
|
|
}, []);
|
2023-07-01 19:10:05 -07:00
|
|
|
return (
|
|
|
|
|
<Stack spacing="md">
|
|
|
|
|
<AudioSettings />
|
2023-09-22 00:06:13 +00:00
|
|
|
<Suspense fallback={<></>}>{hasFancyAudio && <MpvSettings />}</Suspense>
|
2023-07-01 19:10:05 -07:00
|
|
|
<Divider />
|
2023-10-30 19:22:45 -07:00
|
|
|
<ScrobbleSettings />
|
|
|
|
|
<Divider />
|
2023-07-01 19:10:05 -07:00
|
|
|
<LyricSettings />
|
|
|
|
|
</Stack>
|
|
|
|
|
);
|
2022-12-19 15:59:14 -08:00
|
|
|
};
|