diff --git a/src/components/Dashboard.tsx b/src/components/Dashboard.tsx
index 999c75e..a0fe12c 100644
--- a/src/components/Dashboard.tsx
+++ b/src/components/Dashboard.tsx
@@ -1,5 +1,11 @@
import React from "react";
+import EnvTabsContainer from "./EnvTabsContainer";
+import { EnvTab } from "../types";
export default function Dashboard() {
- return
Hello world
;
+ const onSelectEnvTab = (tab: EnvTab): void => {
+ console.log("tab changed:", tab);
+ };
+
+ return ;
}
diff --git a/src/components/EnvTabsContainer.tsx b/src/components/EnvTabsContainer.tsx
new file mode 100644
index 0000000..d51d75c
--- /dev/null
+++ b/src/components/EnvTabsContainer.tsx
@@ -0,0 +1,39 @@
+import React from "react";
+import Tabs from "@mui/material/Tabs";
+import Tab from "@mui/material/Tab";
+import Box from "@mui/material/Box";
+import { ENVIRONMENT_TABS } from "../const";
+import { EnvTab } from "../types";
+
+interface OnSelectTab {
+ (tab: EnvTab): void;
+}
+
+interface EnvTabsContainerProps {
+ onSelect: OnSelectTab;
+}
+
+export default function EnvTabsContainer({ onSelect }: EnvTabsContainerProps) {
+ const defaultTab = ENVIRONMENT_TABS[0];
+
+ const [selected, setSelected] = React.useState(defaultTab);
+
+ const handleChange = (event: React.SyntheticEvent, newValue: EnvTab) => {
+ setSelected(newValue);
+ onSelect(newValue);
+ };
+
+ const tabs = ENVIRONMENT_TABS.map((tab, index) => {
+ return ;
+ });
+
+ return (
+
+
+
+ {tabs}
+
+
+
+ );
+}
diff --git a/src/const.ts b/src/const.ts
new file mode 100644
index 0000000..108d0fa
--- /dev/null
+++ b/src/const.ts
@@ -0,0 +1,14 @@
+import { EnvTab } from "./types";
+
+export const ENVIRONMENT_TABS: EnvTab[] = [
+ {
+ title: "DEV",
+ id: "dev",
+ dashboardEndpoint: "https://intis-service-checker.dev.televendcloud.com/api/checker/v1/dashboard",
+ },
+ {
+ title: "QA",
+ id: "qa",
+ dashboardEndpoint: "https://intis-service-checker.qa.televendcloud.com/api/checker/v1/dashboard",
+ },
+];
diff --git a/src/types.tsx b/src/types.tsx
new file mode 100644
index 0000000..1ae164f
--- /dev/null
+++ b/src/types.tsx
@@ -0,0 +1,5 @@
+export type EnvTab = {
+ title: string;
+ id: string;
+ dashboardEndpoint: string;
+};