import * as React from 'react'; import { FunctionComponent, ReactNode } from 'react'; import { View, Text, Switch } from 'react-native'; import { UpdateSettingValueCallback } from './types'; import { themeStyle } from '@joplin/lib/theme'; import { ConfigScreenStyles } from './configScreenStyles'; interface Props { settingId: string; value: any; themeId: number; styles: ConfigScreenStyles; label: string; updateSettingValue: UpdateSettingValueCallback; description?: ReactNode; } const SettingsToggle: FunctionComponent = props => { const theme = themeStyle(props.themeId); const styleSheet = props.styles.styleSheet; return ( {props.label} void props.updateSettingValue(props.settingId, value)} /> {props.description} ); }; export default SettingsToggle;