CountBadge.tsx 472 B

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