diff --git a/packages/console/src/components/TabNav/TabNavItem.tsx b/packages/console/src/components/TabNav/TabNavItem.tsx index bf7e7bb8b..72fb788d5 100644 --- a/packages/console/src/components/TabNav/TabNavItem.tsx +++ b/packages/console/src/components/TabNav/TabNavItem.tsx @@ -6,14 +6,24 @@ import { onKeyDownHandler } from '@/utilities/a11y'; import * as styles from './TabNavItem.module.scss'; -type Props = { - href?: string; +type BaseProps = { isActive?: boolean; errorCount?: number; - onClick?: () => void; children: React.ReactNode; }; +type LinkStyleProps = { + href: string; +}; + +type TabStyleProps = { + onClick: () => void; +}; + +type Props = + | (BaseProps & LinkStyleProps & Partial>) + | (BaseProps & TabStyleProps & Partial>); + const TabNavItem = ({ children, href, isActive, errorCount = 0, onClick }: Props) => { const { t } = useTranslation(undefined, { keyPrefix: 'admin_console' }); const location = useLocation();