-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Expand file tree
/
Copy pathEntityInstance.tsx
More file actions
50 lines (44 loc) · 1.4 KB
/
Copy pathEntityInstance.tsx
File metadata and controls
50 lines (44 loc) · 1.4 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
46
47
48
49
50
import React from "react";
import { Route, Routes, useNavigate, useParams } from "react-router-dom";
import { EuiPageTemplate } from "@elastic/eui";
import { EntityIcon } from "../../graphics/EntityIcon";
import { useMatchExact } from "../../hooks/useMatchSubpath";
import EntityOverviewTab from "./EntityOverviewTab";
import { useDocumentTitle } from "../../hooks/useDocumentTitle";
import {
useEntityCustomTabs,
useEntityCustomTabRoutes,
} from "../../custom-tabs/TabsRegistryContext";
const EntityInstance = () => {
const navigate = useNavigate();
let { entityName } = useParams();
const { customNavigationTabs } = useEntityCustomTabs(navigate);
const CustomTabRoutes = useEntityCustomTabRoutes();
useDocumentTitle(`${entityName} | Entity | Feast`);
return (
<EuiPageTemplate panelled>
<EuiPageTemplate.Header
restrictWidth
iconType={EntityIcon}
pageTitle={`Entity: ${entityName}`}
tabs={[
{
label: "Overview",
isSelected: useMatchExact(""),
onClick: () => {
navigate("");
},
},
...customNavigationTabs,
]}
/>
<EuiPageTemplate.Section>
<Routes>
<Route path="/" element={<EntityOverviewTab />} />
{CustomTabRoutes}
</Routes>
</EuiPageTemplate.Section>
</EuiPageTemplate>
);
};
export default EntityInstance;