diff --git a/app/components/RuleItem.vue b/app/components/RuleItem.vue index c4f80b0..31fd115 100644 --- a/app/components/RuleItem.vue +++ b/app/components/RuleItem.vue @@ -3,6 +3,8 @@ import type { RuleConfigStates, RuleInfo, RuleLevel } from '~~/shared/types' import { useClipboard } from '@vueuse/core' import { getRuleLevel, getRuleOptions } from '~~/shared/rules' import { vTooltip } from 'floating-vue' +import { deepCompareOptions } from '~/composables/options' +import { getRuleDefaultOptions } from '~/composables/payload' const props = defineProps<{ rule: RuleInfo @@ -17,6 +19,11 @@ const emit = defineEmits<{ stateClick: [RuleLevel] }>() +function redundantOptions(options: any) { + const { hasRedundantOptions } = deepCompareOptions(options ?? [], getRuleDefaultOptions(props.rule.name)) + return hasRedundantOptions +} + const { copy } = useClipboard() function capitalize(str?: string) { @@ -38,6 +45,7 @@ function capitalize(str?: string) { :level="s.level" :config-index="s.configIndex" :has-options="!!s.options?.length" + :has-redundant-options="redundantOptions(s.options)" />