// @flow import { SETTINGS_GRP } from 'constants/settings'; import React from 'react'; import Button from 'component/button'; import Card from 'component/common/card'; import SettingDataHosting from 'component/settingDataHosting'; import SettingViewHosting from 'component/settingViewHosting'; import SettingSaveBlobs from 'component/settingSaveBlobs'; import SettingsRow from 'component/settingsRow'; import AppStorageViz from 'component/appStorageVisualization'; import Spinner from 'component/spinner'; import classnames from 'classnames'; type DaemonSettings = { save_blobs: boolean, }; type Props = { daemonSettings: DaemonSettings, isSetting: boolean, isWelcome?: boolean, cleanBlobs: () => Promise, }; export default function SettingStorage(props: Props) { const { daemonSettings, isSetting, isWelcome, cleanBlobs } = props; const saveBlobs = daemonSettings && daemonSettings.save_blobs; const [isCleaning, setCleaning] = React.useState(false); // currently, it seems, blob space statistics are only updated during clean React.useEffect(() => { setCleaning(true); cleanBlobs().then(() => { setCleaning(false); }); }, []); return ( <>

{isWelcome ? __('Custom Hosting') : __('Hosting')} {(isSetting || isCleaning) && }

{__('Help improve the P2P data network (and make LBRY users happy) by hosting data.')} } footer={} > {__("View History Hosting lets you choose how much storage to use hosting content you've consumed.")}{' '}