Skip to content

Commit 0cd1054

Browse files
feat: add currentMaiaModel selector to GameInfo component
1 parent adb0821 commit 0cd1054

File tree

2 files changed

+36
-1
lines changed

2 files changed

+36
-1
lines changed

src/components/Misc/GameInfo.tsx

+28
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,49 @@ interface Props {
88
title: string
99
type: InstructionsType
1010
children: React.ReactNode
11+
currentMaiaModel?: string
12+
setCurrentMaiaModel?: (model: string) => void
13+
MAIA_MODELS?: string[]
1114
}
1215

1316
export const GameInfo: React.FC<Props> = ({
1417
icon,
1518
title,
1619
type,
1720
children,
21+
currentMaiaModel,
22+
setCurrentMaiaModel,
23+
MAIA_MODELS,
1824
}: Props) => {
1925
const { setInstructionsModalProps } = useContext(ModalContext)
26+
2027
return (
2128
<div className="flex w-full flex-col items-start justify-start gap-1 overflow-hidden bg-background-1 p-3 md:rounded">
2229
<div className="flex w-full items-center justify-between">
2330
<div className="flex items-center justify-start gap-1.5">
2431
<span className="material-symbols-outlined text-xl">{icon}</span>
2532
<h2 className="text-xl font-semibold">{title}</h2>
33+
{currentMaiaModel && setCurrentMaiaModel && (
34+
<p className="flex items-center gap-1 text-sm md:hidden">
35+
using
36+
<div className="relative inline-flex items-center gap-0.5">
37+
<select
38+
value={currentMaiaModel}
39+
className="cursor-pointer appearance-none bg-transparent focus:outline-none"
40+
onChange={(e) => setCurrentMaiaModel(e.target.value)}
41+
>
42+
{MAIA_MODELS?.map((model) => (
43+
<option value={model} key={model}>
44+
{model.replace('maia_kdd_', 'Maia ')}
45+
</option>
46+
))}
47+
</select>
48+
<span className="material-symbols-outlined pointer-events-none text-sm">
49+
arrow_drop_down
50+
</span>
51+
</div>
52+
</p>
53+
)}
2654
</div>
2755
<button
2856
className="material-symbols-outlined duration-200 hover:text-human-3"

src/pages/analysis/[...id].tsx

+8-1
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,14 @@ const Analysis: React.FC<Props> = ({
583583
<>
584584
<div className="flex h-full flex-1 flex-col justify-center gap-1">
585585
<div className="flex w-full flex-col items-start justify-start gap-1">
586-
<GameInfo title="Analysis" icon="bar_chart" type="analysis">
586+
<GameInfo
587+
title="Analysis"
588+
icon="bar_chart"
589+
type="analysis"
590+
currentMaiaModel={currentMaiaModel}
591+
setCurrentMaiaModel={setCurrentMaiaModel}
592+
MAIA_MODELS={MAIA_MODELS}
593+
>
587594
<NestedGameInfo />
588595
</GameInfo>
589596
<div className="relative flex h-[100vw] w-screen">

0 commit comments

Comments
 (0)