From 9ef21d99bdf2ea5b1578fd53e5bba774b4b6c5a3 Mon Sep 17 00:00:00 2001 From: Cailyn Sinclair Date: Thu, 21 May 2026 15:02:39 -0700 Subject: [PATCH] Include natshelper stage prefixes in nametag CSV export --- src/pages/Competition/Export/index.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/pages/Competition/Export/index.tsx b/src/pages/Competition/Export/index.tsx index 80b102f..df1c29b 100644 --- a/src/pages/Competition/Export/index.tsx +++ b/src/pages/Competition/Export/index.tsx @@ -69,8 +69,15 @@ const groupNumber = ({ activityCode }: Pick) => const staffingAssignmentToText = ({ assignmentCode, activity }: AssignmentWithActivity) => `${assignmentCode.split('-')[1][0].toUpperCase()}${groupNumber(activity)}`; +const stagePrefixForNametags = (room: Room, activity: ActivityWithParent) => { + const stageName = getStageName(room, activity); + const stagePrefix = stageName.match(/[A-Za-z]+/)?.[0]; + + return stagePrefix || room.name[0]; +}; + const competingAssignmentToText = (activity: ActivityWithParent) => - `${activity.parent.room.name[0]}${groupNumber(activity)}`; + `${stagePrefixForNametags(activity.parent.room, activity)}${groupNumber(activity)}`; const getStageName = (room: Room, activity: ActivityWithParent) => { const stages = getRoomExtensionData(room)?.stages;