aboutsummaryrefslogtreecommitdiff
path: root/server/frontend/src/App.tsx
blob: bdc1007daf0c6537cd77f30184504ab4ca71c7ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import { For, Suspense, type Component } from "solid-js";
import { A, createAsync } from "@solidjs/router";
import { client, getAnalysisList } from "./api.ts";

const App: Component = () => {
  let analysis = createAsync(() => getAnalysisList());
  return (
    <>
      <Suspense fallback="Loading analysis...">
        <ul>
          <For each={analysis()?.data}>
            {item =>
              <li><A href={`/analysis/${item.id}`}>{item.name}</A></li>
            }
          </For>
        </ul>
      </Suspense>
    </>
  );
};

export default App;