import { useI18n } from '@solid-primitives/i18n' import { IconReload } from '@tabler/icons-solidjs' import InfiniteScroll from 'solid-infinite-scroll' import { For, Show, createMemo, createSignal, onMount } from 'solid-js' import { Button } from '~/components' import { formatTimeFromNow, handlerBtnClickWithAnimate } from '~/helpers' import { useRules } from '~/signals' export default () => { const [t] = useI18n() const { rules, rulesProviders, updateRules, updateAllRuleProvider, updateRuleProviderByName, } = useRules() const [maxRuleRender, setMaxRuleRender] = createSignal(100) const renderRules = createMemo(() => rules().slice(0, maxRuleRender())) onMount(updateRules) const onUpdateProviderClick = (e: MouseEvent, name: string) => { handlerBtnClickWithAnimate(e, updateRuleProviderByName.bind(null, name)) } const onUpdateAllProviderClick = (e: MouseEvent) => { handlerBtnClickWithAnimate(e, updateAllRuleProvider) } return (

{t('rules')}

setMaxRuleRender(maxRuleRender() + 100)} > {(rule) => (
{rule.payload} {rule.size !== -1 && ` (${rule.size})`}
{rule.type} :: {rule.proxy}
)}
0}>

{t('ruleProviders')}

{(rulesProvider) => (
{rulesProvider.name} ({rulesProvider.ruleCount})
{rulesProvider.vehicleType} / {rulesProvider.behavior} / Updated {formatTimeFromNow(rulesProvider.updatedAt)}
)}
) }