diff --git a/studio-v2/app/learn/[unitId]/match/page.tsx b/studio-v2/app/learn/[unitId]/match/page.tsx index e5bda07..d3ee469 100644 --- a/studio-v2/app/learn/[unitId]/match/page.tsx +++ b/studio-v2/app/learn/[unitId]/match/page.tsx @@ -16,6 +16,24 @@ interface QAItem { function getApiBase() { return '' } +function SelectedImage({ items, selectedId, isDark }: { items: QAItem[]; selectedId: string | null; isDark: boolean }) { + if (!selectedId) return null + const item = items.find(i => i.id === selectedId) + if (!item?.image_url) return null + const isEmoji = item.image_url.length <= 4 + return ( +
+ {isEmoji ? ( + {item.image_url} + ) : ( + {item.question} + )} +
+ ) +} + export default function MatchPage() { const { unitId } = useParams<{ unitId: string }>() const router = useRouter() @@ -193,26 +211,7 @@ export default function MatchPage() { {/* Image preview for selected word */} - {selectedLeft && (() => { - const item = roundItems.find(i => i.id === selectedLeft) - if (!item?.image_url) return null - const isEmoji = item.image_url.length <= 4 - return ( -
- {isEmoji ? ( - {item.image_url} - ) : ( - {item.question} - )} -
- ) - })()} + )} )