display check on accomplished game
This commit is contained in:
parent
36b78a94e2
commit
1d12771804
|
@ -1,8 +1,13 @@
|
|||
import React from "react";
|
||||
import { useUser } from "../user-context";
|
||||
|
||||
function GameDisplay({ record: { title, Game } }: { record: GameRecord }) {
|
||||
function GameDisplay({ record: { title, Game, id } }: { record: GameRecord }) {
|
||||
const { user } = useUser();
|
||||
const completed = user?.tests.some((t) => (
|
||||
(t.done === true) && (t.id === id)
|
||||
));
|
||||
return <div>
|
||||
<h4 className="my-4"><span role="img" aria-label="">🎮</span> {title}</h4>
|
||||
<h4 className="my-4"><span role="img" aria-label="">🎮</span> {title} {completed ? "✅" : ""}</h4>
|
||||
<Game />
|
||||
</div>
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue