CountBadge.tsx 437 B

1234567891011121314151617181920
  1. import React, { FC } from 'react';
  2. type CountProps = {
  3. count?: number,
  4. offset?: number,
  5. }
  6. const CountBadge: FC<CountProps> = (props:CountProps) => {
  7. const { count, offset = 0 } = props;
  8. return (
  9. <span className="grw-count-badge px-2 badge badge-pill badge-light">
  10. { count == null && <span className="text-muted">―</span> }
  11. { count != null && count + offset }
  12. </span>
  13. );
  14. };
  15. export default CountBadge;