import { NumberInput, Slider, Switch } from '/@/renderer/components'; import { usePlaybackSettings, useSettingsStoreActions } from '/@/renderer/store/settings.store'; import { SettingOption, SettingsSection } from '../settings-section'; import { useTranslation } from 'react-i18next'; export const ScrobbleSettings = () => { const { t } = useTranslation(); const settings = usePlaybackSettings(); const { setSettings } = useSettingsStoreActions(); const scrobbleOptions: SettingOption[] = [ { control: ( { setSettings({ playback: { ...settings, scrobble: { ...settings.scrobble, enabled: e.currentTarget.checked, }, }, }); }} /> ), description: t('setting.scrobble', { context: 'description', postProcess: 'sentenceCase', }), title: t('setting.scrobble', { postProcess: 'sentenceCase' }), }, { control: ( { setSettings({ playback: { ...settings, scrobble: { ...settings.scrobble, scrobbleAtPercentage: e, }, }, }); }} /> ), description: t('setting.minimumScrobblePercentage', { context: 'description', postProcess: 'sentenceCase', }), title: t('setting.minimumScrobblePercentage', { postProcess: 'sentenceCase' }), }, { control: ( { if (e === '') return; setSettings({ playback: { ...settings, scrobble: { ...settings.scrobble, scrobbleAtDuration: e, }, }, }); }} /> ), description: t('setting.minimumScrobbleSeconds', { context: 'description', postProcess: 'sentenceCase', }), title: t('setting.minimumScrobbleSeconds', { postProcess: 'sentenceCase' }), }, ]; return ; };