Files
jellyfin-audio-player/src/screens/Settings/stacks/PlaybackReporting.tsx
Kris c4838b3b9e Fixed Android Safe View Areas (#294)
* Fixed Android safe view areas

* fix: xmark positioning

* fix: redundant safeareaprovider

* fix: roll back redundant changes

* fix: linter

---------

Co-authored-by: Lei Nelissen <lei@codified.nl>
2025-08-05 00:03:40 +02:00

27 lines
1.1 KiB
TypeScript

import { Paragraph } from '@/components/Typography';
import React, { useCallback } from 'react';
import { Switch } from 'react-native-gesture-handler';
import { t } from '@/localisation';
import { useAppDispatch, useTypedSelector } from '@/store';
import { setEnablePlaybackReporting } from '@/store/settings/actions';
import Container from '../components/Container';
import { SwitchContainer, SwitchLabel } from '../components/Switch';
export default function PlaybackReporting() {
const isEnabled = useTypedSelector((state) => state.settings.enablePlaybackReporting);
const dispatch = useAppDispatch();
const toggleSwitch = useCallback(() => {
dispatch(setEnablePlaybackReporting(!isEnabled));
}, [isEnabled, dispatch]);
return (
<Container>
<Paragraph>{t('playback-reporting-description')}</Paragraph>
<SwitchContainer>
<SwitchLabel>{t('playback-reporting')}</SwitchLabel>
<Switch value={isEnabled} onValueChange={toggleSwitch} />
</SwitchContainer>
</Container>
);
}