-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathindex.tsx
30 lines (29 loc) · 886 Bytes
/
index.tsx
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
import { AppFrame } from "$components/AppFrame.tsx";
import { OrgList } from "$components/OrgList.tsx";
import { User } from "$components/User.tsx";
import LocalKvList from "$islands/LocalKvList.tsx";
import RemoteKvList from "$islands/RemoteKvList.tsx";
import { getRootData } from "$utils/dash.ts";
import { state } from "$utils/state.ts";
export default async function Home() {
const loggedIn = !!state.accessToken.value;
let data;
let user;
if (loggedIn) {
data = await getRootData();
user = data.user;
}
return (
<AppFrame selected="home">
<LocalKvList stores={state.localStores.value} />
{user && (
<div>
<h1 class="text-xl font-bold py-2">User</h1>
<User data={user} />
</div>
)}
{data && <OrgList data={data} />}
<RemoteKvList stores={state.remoteStores.value} />
</AppFrame>
);
}