+ {enabledGamemodes.map(tab => {
+ const active = tab === props.active
+ const commonAttrs = {
+ class: [
+ 'rounded-md px-3 py-1.5 text-sm leading-none font-bold whitespace-nowrap',
+ active ? 'bg-accent text-white' : 'text-abru-light-60 hover:text-white',
+ ],
+ role: 'tab',
+ 'aria-selected': active ? 'true' : 'false',
+ 'data-umami-event': 'switch-gamemode',
+ 'data-umami-event-gamemode': tab,
+ ...(props.hxTarget ? { 'hx-target': props.hxTarget } : {}),
+ }
+ return props.fragment ? (
+
+ ) : (
+
+ {gamemodeDisplayName(tab)}
+
+ )
+ })}
+
+ )
+}
diff --git a/src/routes/admin/games/index.ts b/src/routes/admin/games/index.ts
index 5e393c507..f731ddb59 100644
--- a/src/routes/admin/games/index.ts
+++ b/src/routes/admin/games/index.ts
@@ -1,5 +1,6 @@
import { PlayerRole } from '../../../database/models/player.model'
import { CooldownLevelEntry, GamesPage } from '../../../admin/games/views/html/games.page'
+import { WhitelistId } from '../../../admin/games/views/html/whitelist-id'
import { z } from 'zod'
import { LogsTfUploadMethod } from '../../../shared/types/logs-tf-upload-method'
import { requestContext } from '@fastify/request-context'
@@ -7,6 +8,8 @@ import { secondsToMilliseconds } from 'date-fns'
import { routes } from '../../../utils/routes'
import { configuration } from '../../../configuration'
import { durationUnit } from '../../../admin/games/duration-unit'
+import { Gamemode } from '../../../shared/types/gamemode'
+import { defaultGamemode } from '../../../shared/default-gamemode'
// A single form field is submitted as a scalar, multiple as an array; normalize both to an array.
const formArray =