import { css, palette2, styled } from '@ringcentral/juno'; import clsx from 'clsx'; import type { FunctionComponent } from 'react'; import React from 'react'; import styles from './styles.scss'; type NavigationButtonProps = { icon: React.ReactNode; active?: boolean; label?: string; noticeCounts?: number; width: number | string; onClick?: (...args: any[]) => any; fullSizeInk?: boolean; }; type StyledTabProps = { $active: boolean }; const tabColor = palette2('tab', 'selected'); export const StyledTab = styled.div` ${({ $active }) => $active && css` color: ${tabColor}; border-bottom: 1px solid ${tabColor}; `}; `; const NavigationButton: FunctionComponent = ({ active, icon, label, noticeCounts, onClick, width, fullSizeInk, }) => { 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, fullSizeInk: true, }; export default NavigationButton;