// @flow import { ALERT } from 'constants/icons'; import React from 'react'; import Button from 'component/button'; import Card from 'component/common/card'; import { FormField } from 'component/common/form'; import SettingAutoLaunch from 'component/settingAutoLaunch'; import SettingClosingBehavior from 'component/settingClosingBehavior'; import SettingsRow from 'component/settingsRow'; // @if TARGET='app' const IS_MAC = process.platform === 'darwin'; // @endif type Price = { currency: string, amount: number, }; type SetDaemonSettingArg = boolean | string | number | Price; type DaemonSettings = { download_dir: string, share_usage_data: boolean, max_key_fee?: Price, max_connections_per_download?: number, save_files: boolean, save_blobs: boolean, ffmpeg_path: string, }; type Props = { daemonSettings: DaemonSettings, setDaemonSetting: (string, ?SetDaemonSettingArg) => void, clearCache: () => Promise, }; export default function SettingSystem(props: Props) { const { daemonSettings, setDaemonSetting, clearCache } = props; const [clearingCache, setClearingCache] = React.useState(false); return ( {/* @if TARGET='app' */} setDaemonSetting('save_files', !daemonSettings.save_files)} checked={daemonSettings.save_files} /> {__("If disabled, LBRY will be very sad and you won't be helping improve the network.")}{' '}