bigbuffet-rw/app/soapbox/components/ui/counter/counter.tsx

20 lines
493 B
TypeScript
Raw Normal View History

2022-04-28 14:29:15 -07:00
import React from 'react';
import { shortNumberFormat } from 'soapbox/utils/numbers';
interface ICounter {
/** Number this counter should display. */
2022-04-28 14:29:15 -07:00
count: number,
}
/** A simple counter for notifications, etc. */
const Counter: React.FC<ICounter> = ({ count }) => {
return (
<span className='block px-1.5 py-0.5 bg-secondary-500 text-xs text-white rounded-full ring-2 ring-white dark:ring-gray-800'>
2022-04-28 14:29:15 -07:00
{shortNumberFormat(count)}
</span>
);
};
export default Counter;