import React from 'react'; import { useClearFailedQueue } from '../../services/settings'; import Icon from '../common/Icon'; import SelectField, { SelectionOption } from '../common/SelectField'; type ScraperSettingsProps = { settings: SettingsType, settingsError: null | { type: string, msg: string }, updateSettings: Function, } const ScraperSettings = ({ settings, settingsError, updateSettings }:ScraperSettingsProps) => { const { mutate: clearFailedMutate, isLoading: clearingQueue } = useClearFailedQueue(() => {}); const scrapingOptions: SelectionOption[] = [ { label: 'Daily', value: 'daily' }, { label: 'Every Other Day', value: 'other_day' }, { label: 'Weekly', value: 'weekly' }, { label: 'Monthly', value: 'monthly' }, { label: 'Never', value: 'never' }, ]; const delayOptions: SelectionOption[] = [ { label: 'No Delay', value: '0' }, { label: '5 Seconds', value: '5000' }, { label: '10 Seconds', value: '10000' }, { label: '30 Seconds', value: '30000' }, { label: '1 Minutes', value: '60000' }, { label: '2 Minutes', value: '120000' }, { label: '5 Minutes', value: '300000' }, { label: '10 Minutes', value: '600000' }, { label: '15 Minutes', value: '900000' }, { label: '30 Minutes', value: '1800000' }, ]; const allScrapers: SelectionOption[] = settings.available_scapers ? settings.available_scapers : []; const scraperOptions: SelectionOption[] = [{ label: 'None', value: 'none' }, ...allScrapers]; const labelStyle = 'mb-2 font-semibold inline-block text-sm text-gray-700 capitalize'; return (