Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/components/TournamentMatches.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
});
Expand All @@ -213,7 +221,7 @@ onMounted(() => {
:class="{ selected: selectedGroupOption === option }"
@click="selectedGroupOption = option"
>
by {{ option }}
by {{ getFriendlyOptionName(option) }}
</div>
</div>
<div class="filters">
Expand Down
Loading