import * as React from 'react'; import classNames from 'classnames'; import { Text } from '@box/blueprint-web'; import CompactCount from './CompactCount'; import './HeaderWithCount.scss'; interface Props { isRedesignEnabled?: boolean; title: string; totalCount?: number; } function isNumber(count?: number): count is number { return typeof count === 'number'; } function HeaderWithCount({ isRedesignEnabled, title, totalCount }: Props) { return (
{isRedesignEnabled ? ( <> {title} {isNumber(totalCount) && ( )} ) : ( <> {title} {isNumber(totalCount) && } )}
); } export default HeaderWithCount;