import clsx from 'clsx'; import React from 'react'; import styles from './styles.scss'; type DropdownNavigationItemProps = { icon: React.ReactNode; activeIcon: React.ReactNode; active?: boolean; isReverseFillIcon?: boolean; label?: string; title?: string; noticeCounts?: number; onClick?: (...args: any[]) => any; keepStyle?: boolean; dataSign?: string; }; const DropdownNavigationItem: React.FC = ({ icon, activeIcon, active, isReverseFillIcon, label, title, noticeCounts, onClick, keepStyle, dataSign, }) => { let notice = null; if (noticeCounts && noticeCounts > 0) { if (noticeCounts > 99) { notice =
99+
; } else { notice =
{noticeCounts}
; } } const styleClass = !keepStyle ? styles.iconStyles : null; return (
{active ? activeIcon : icon}
{label}
{notice}
); }; DropdownNavigationItem.defaultProps = { active: false, isReverseFillIcon: false, label: undefined, title: undefined, noticeCounts: undefined, onClick: undefined, keepStyle: false, }; export default DropdownNavigationItem;