84b474c3cc
* number display formatting * - add tests
23 lines
431 B
TypeScript
23 lines
431 B
TypeScript
import styled from '@emotion/styled';
|
|
|
|
import { formatNumber } from '~/utils/format/number';
|
|
|
|
const StyledNumberDisplay = styled.div`
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
width: 100%;
|
|
`;
|
|
|
|
type OwnProps = {
|
|
value: string;
|
|
};
|
|
|
|
export function NumberDisplay({ value }: OwnProps) {
|
|
return (
|
|
<StyledNumberDisplay>
|
|
{value && formatNumber(Number(value))}
|
|
</StyledNumberDisplay>
|
|
);
|
|
}
|