/
Navbar.tsx
35 lines (32 loc) · 1.24 KB
/
Navbar.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
import { FiHome } from "react-icons/fi";
import { PiLinkSimpleBold } from "react-icons/pi";
import { Link, useLocation } from "react-router-dom";
import { KURTOSIS_CLOUD_CONNECT_URL } from "../client/constants";
import { useKurtosisClient } from "../client/enclaveManager/KurtosisClientContext";
import { NavButton, Navigation } from "../components/Navigation";
export type NavbarProps = {
baseApplicationUrl: URL;
};
export const Navbar = ({ baseApplicationUrl }: NavbarProps) => {
const location = useLocation();
const kurtosisClient = useKurtosisClient();
return (
<Navigation baseApplicationUrl={baseApplicationUrl}>
<Link to={"/"}>
<NavButton
label={"View enclaves"}
Icon={<FiHome />}
isActive={location.pathname === "/" || location.pathname.startsWith("/enclave")}
/>
</Link>
{kurtosisClient.isRunningInCloud() && (
<Link to={KURTOSIS_CLOUD_CONNECT_URL}>
<NavButton label={"Link your CLI"} Icon={<PiLinkSimpleBold />} isActive={true} />
</Link>
)}
{/*<Link to={"/catalog"}>*/}
{/* <NavButton label={"View catalog"} Icon={<FiPackage />} isActive={location.pathname.startsWith("/catalog")} />*/}
{/*</Link>*/}
</Navigation>
);
};