import { FC, useState } from "react"; import { Range } from "react-range"; import type { Settings } from "Stores/Settings"; const FetchConfiguration: FC<{ settingsStore: Settings; }> = ({ settingsStore }) => { const [fetchInterval, setFetchInterval] = useState([ settingsStore.fetchConfig.config.interval, ]); const onChangeComplete = (value: number) => { settingsStore.fetchConfig.setInterval(value); }; return (
setFetchInterval(values)} onFinalChange={(values) => onChangeComplete(values[0])} renderTrack={({ props, children }) => { const { key, ...restProps } = props as typeof props & { key?: string; }; return (
{children}
); }} renderThumb={({ props }) => { const { key, ...restProps } = props as typeof props & { key?: string; }; return (
{fetchInterval}s
); }} />
); }; export { FetchConfiguration };