import { useI18n } from '@solid-primitives/i18n' import InfiniteScroll from 'solid-infinite-scroll' import { For, createMemo, createSignal, onMount } from 'solid-js' import { useRequest } from '~/signals' import type { Rule, RuleProvider } from '~/types' export default () => { const [t] = useI18n() const request = useRequest() const [maxRuleRender, setMaxRuleRender] = createSignal(100) const [rules, setRules] = createSignal([]) const [rulesProviders, setRulesProviders] = createSignal([]) const renderRules = createMemo(() => rules().slice(0, maxRuleRender())) onMount(async () => { const { rules } = await request .get('rules') .json<{ rules: Record }>() setRules(Object.values(rules)) const { providers } = await request .get('providers/rules') .json<{ providers: Record }>() setRulesProviders(Object.values(providers)) }) return (

{t('rules')}

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

{t('ruleProviders')}

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