From 9d4db93097a0eabde5c30648a8a8b07f6804c3c9 Mon Sep 17 00:00:00 2001 From: Samuel Gunter Date: Fri, 22 Mar 2024 18:52:08 -0500 Subject: [PATCH] fix: don't crash on cultural diversity flag (#196) Co-authored-by: Som Gupta <78577376+knownotunknown@users.noreply.github.com> --- src/views/components/common/Chip.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/views/components/common/Chip.tsx b/src/views/components/common/Chip.tsx index edd5c20ed..c8ff05afd 100644 --- a/src/views/components/common/Chip.tsx +++ b/src/views/components/common/Chip.tsx @@ -9,7 +9,7 @@ export const flagMap = { Writing: 'WR', 'Quantitative Reasoning': 'QR', 'Global Cultures': 'GC', - 'Cultural Diversity in the United States': 'CD', + 'Cultural Diversity': 'CD', Ethics: 'E', 'Independent Inquiry': 'II', } as const satisfies Record; @@ -31,7 +31,7 @@ export function Chip({ label }: React.PropsWithChildren): JSX.Element { style={{ backgroundColor: '#FFD600', }} - title={Object.entries(flagMap).find(([full, short]) => short === label)![0]} + title={Object.entries(flagMap).find(([full, short]) => short === label)?.[0] ?? label} > {label}