import clsx from 'clsx'; import React from 'react'; import { StyledTab } from '../MessageTabButton/MessageTabButton'; import styles from './styles.scss'; type NavigationButtonProps = { icon: React.ReactNode; active?: boolean; label?: string; noticeCounts?: number; width: number | string; onClick?: (...args: any[]) => any; }; const NavigationButton: React.FC = ({ active, icon, label, noticeCounts, onClick, width, }) => { let notice = null; if (noticeCounts && noticeCounts > 0) { if (noticeCounts > 99) { notice =
99+
; } else { notice =
{noticeCounts}
; } } return (
{icon}
{notice}
); }; NavigationButton.defaultProps = { active: false, label: undefined, noticeCounts: undefined, onClick: undefined, }; export default NavigationButton;