18 lines
393 B
TypeScript
18 lines
393 B
TypeScript
import { A } from "@solidjs/router";
|
|
import { createEffect, createResource, For } from "solid-js";
|
|
import api from "../api";
|
|
|
|
export default () => {
|
|
const [games] = createResource(async () =>
|
|
api.games.get().then((res) => res.data)
|
|
);
|
|
|
|
return (
|
|
<div style={{ padding: "20px" }}>
|
|
<For each={games()}>
|
|
{(game) => <A href={`/${game.key}`}>{game.name}</A>}
|
|
</For>
|
|
</div>
|
|
);
|
|
};
|