-
Notifications
You must be signed in to change notification settings - Fork 56
Expand file tree
/
Copy pathshow.tsx
More file actions
45 lines (39 loc) · 1.11 KB
/
show.tsx
File metadata and controls
45 lines (39 loc) · 1.11 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import React, { useContext } from "react";
import { Outlet, useParams } from "react-router-dom";
import { AppContext } from "../../../app-context.jsx";
import { TabNavigation } from "../../../components/TabNavigation.jsx";
export async function clientLoader() {
return {
redirect: "overview",
};
}
export function CloudTenantShow() {
const { tenantId } = useParams();
const { cloud } = useContext(AppContext);
const listTenants = cloud.getListTenantsByUser();
if (listTenants.isPending) {
return <div>Loading...</div>;
}
if (!listTenants.data) {
return <div>Not found</div>;
}
const tenant = listTenants.data.tenants.find((t) => t.tenantId === tenantId);
if (!tenant) {
return <div>Not found</div>;
}
const tabs = [
// { id: "overview", label: "Overview" },
{ id: "members", label: "Members" },
{ id: "admin", label: "Settings" },
];
return (
<div className="flex h-full">
<div className="flex-1 overflow-auto">
<TabNavigation tabs={tabs} className="mb-4" />
<div className="">
<Outlet />
</div>
</div>
</div>
);
}