From 7f917825ff7b4e1b5369ddb0473c6d27c5a3ba02 Mon Sep 17 00:00:00 2001 From: davidohnee Date: Fri, 28 Aug 2026 16:42:51 +0200 Subject: [PATCH] matches: show filter 'by court' or 'by table' dynamically based on selected sport --- src/components/TournamentMatches.vue | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/components/TournamentMatches.vue b/src/components/TournamentMatches.vue index adfc1d0..d318e33 100644 --- a/src/components/TournamentMatches.vue +++ b/src/components/TournamentMatches.vue @@ -8,6 +8,7 @@ import { GROUP_OPTIONS, groupMatches, tournamentRichMatches } from "@/helpers/ma import TabSelector from "./TabSelector.vue"; import MatchFilter from "./filter/MatchFilter.vue"; import type { Option } from "@/types/common"; +import { getCourtType } from "@/helpers/defaults.ts"; const props = defineProps<{ modelValue: Tournament; @@ -196,6 +197,13 @@ const resetFilters = () => { }); }; +const getFriendlyOptionName = (option: (typeof GROUP_OPTIONS)[number]) => { + if (option == "court") { + return getCourtType(tournament.value.config.sport, false, false); + } + return option; +}; + onMounted(() => { autoSelectGroup(); }); @@ -213,7 +221,7 @@ onMounted(() => { :class="{ selected: selectedGroupOption === option }" @click="selectedGroupOption = option" > - by {{ option }} + by {{ getFriendlyOptionName(option) }}