aboutsummaryrefslogtreecommitdiff
path: root/server/frontend/src/Test.tsx
blob: 15d2f7330abff2849d174896ed12d8615fbbccc0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import { A, createAsync } from "@solidjs/router";
import { client } from "./api.js";
import { For, Suspense } from "solid-js";

export default function Test() {
  let items = createAsync(() =>
    client.GET("/item", {
      params: {
        query: {
          itemId: ["HYPERION", "BAT_WAND"],
        },
      },
    })
  );
  return (
    <>
      Test page <A href={"/"}>Back to main</A>
      <hr />
      <Suspense fallback={"Loading items..."}>
        <p>Here are all Items:</p>
        <For each={Object.entries(items()?.data || {})}>
          {([id, name]) => (
            <li>
              <code>{id}</code>: {name}
            </li>
          )}
        </For>
      </Suspense>
    </>
  );
}