mirror of
https://github.com/logto-io/logto.git
synced 2024-12-16 20:26:19 -05:00
refactor(console): TabNavItem
props type (#2630)
This commit is contained in:
parent
25f0a2e158
commit
2c1640d889
1 changed files with 13 additions and 3 deletions
|
@ -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<Record<keyof TabStyleProps, undefined>>)
|
||||
| (BaseProps & TabStyleProps & Partial<Record<keyof LinkStyleProps, undefined>>);
|
||||
|
||||
const TabNavItem = ({ children, href, isActive, errorCount = 0, onClick }: Props) => {
|
||||
const { t } = useTranslation(undefined, { keyPrefix: 'admin_console' });
|
||||
const location = useLocation();
|
||||
|
|
Loading…
Reference in a new issue