Skip to content

Commit

Permalink
Simplify VFilterTab by using $tc filter
Browse files Browse the repository at this point in the history
  • Loading branch information
AetherUnbound committed May 28, 2024
1 parent 972ba83 commit bbedbed
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions frontend/src/components/VHeader/VHeaderMobile/VFilterTab.vue
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
<template>
<VTab id="filters" size="medium" class="gap-x-2" :aria-label="ariaLabel">
<VTab
id="filters"
size="medium"
class="gap-x-2"
:aria-label="$tc('header.filterButton.withCount', appliedFilterCount)"
>
<VFilterIconOrCounter :applied-filter-count="appliedFilterCount" />
<h2 class="label-regular">{{ $t("filters.title") }}</h2>
</VTab>
</template>
<script lang="ts">
import { computed, defineComponent } from "vue"
import { useI18n } from "~/composables/use-i18n"
import VFilterIconOrCounter from "~/components/VHeader/VFilterIconOrCounter.vue"
import VTab from "~/components/VTabs/VTab.vue"
export default defineComponent({
export default {
name: "VFilterTab",
components: { VFilterIconOrCounter, VTab },
props: {
Expand All @@ -21,12 +22,5 @@ export default defineComponent({
default: 0,
},
},
setup(props) {
const i18n = useI18n()
const ariaLabel = computed(() =>
i18n.tc("header.filterButton.withCount", props.appliedFilterCount)
)
return { ariaLabel }
},
})
}
</script>

0 comments on commit bbedbed

Please sign in to comment.