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 { useRules } from '~/signals/rules' 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(async () => { updateRules() }) const onUpdateProviderClick = async (e: MouseEvent, name: string) => { const el = e.target as HTMLElement el.classList.add('animate-spin') e.stopPropagation() await updateRuleProviderByName(name) el.classList.remove('animate-spin') } const onUpdateAllProviderClick = async (e: MouseEvent) => { const el = e.target as HTMLElement el.classList.add('animate-spin') e.stopPropagation() await updateAllRuleProvider() el.classList.remove('animate-spin') } return (

{t('rules')}

setMaxRuleRender(maxRuleRender() + 100)} > {(rule) => (
{rule.payload}
{rule.type} :: {rule.proxy}
)}
0}>

{t('ruleProviders')}

{(rulesProvider) => (
{rulesProvider.name}
{rulesProvider.vehicleType} :: {rulesProvider.behavior} ( {rulesProvider.ruleCount})
)}
) }