forked from y-scope/yscope-log-viewer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCustomTabPanel.tsx
65 lines (58 loc) · 1.41 KB
/
CustomTabPanel.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import React from "react";
import {
ButtonGroup,
DialogContent,
DialogTitle,
TabPanel,
Typography,
} from "@mui/joy";
import "./CustomTabPanel.css";
interface CustomTabPanelProps {
children: React.ReactNode,
tabName: string,
title: string,
titleButtons?: React.ReactNode,
}
/**
* Renders a customized tab panel to be extended for displaying extra information in the sidebar.
*
* @param props
* @param props.children
* @param props.tabName
* @param props.title
* @param props.titleButtons
* @return
*/
const CustomTabPanel = ({
children,
tabName,
title,
titleButtons,
}: CustomTabPanelProps) => {
return (
<TabPanel
className={"sidebar-tab-panel"}
value={tabName}
>
<DialogTitle className={"sidebar-tab-panel-title-container"}>
<Typography
className={"sidebar-tab-panel-title"}
level={"body-md"}
>
{title}
</Typography>
<ButtonGroup
size={"sm"}
spacing={"1px"}
variant={"plain"}
>
{titleButtons}
</ButtonGroup>
</DialogTitle>
<DialogContent>
{children}
</DialogContent>
</TabPanel>
);
};
export default CustomTabPanel;