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>
	);
};
