diff --git a/packages/console/src/components/TabNav/TabNavLink.module.scss b/packages/console/src/components/TabNav/TabNavItem.module.scss similarity index 94% rename from packages/console/src/components/TabNav/TabNavLink.module.scss rename to packages/console/src/components/TabNav/TabNavItem.module.scss index daf9022e1..199dbf45c 100644 --- a/packages/console/src/components/TabNav/TabNavLink.module.scss +++ b/packages/console/src/components/TabNav/TabNavItem.module.scss @@ -8,6 +8,7 @@ a { color: var(--color-caption); text-decoration: none; + cursor: pointer; } } diff --git a/packages/console/src/components/TabNav/TabNavItem.tsx b/packages/console/src/components/TabNav/TabNavItem.tsx new file mode 100644 index 000000000..12df27ab0 --- /dev/null +++ b/packages/console/src/components/TabNav/TabNavItem.tsx @@ -0,0 +1,25 @@ +import classNames from 'classnames'; +import React from 'react'; +import { Link, useLocation } from 'react-router-dom'; + +import * as styles from './TabNavItem.module.scss'; + +type Props = { + href?: string; + isActive?: boolean; + onClick?: () => void; + children: React.ReactNode; +}; + +const TabNavItem = ({ children, href, isActive, onClick }: Props) => { + const location = useLocation(); + const selected = href ? location.pathname === href : isActive; + + return ( +