// Copyright 2017-2021 @polkadot/apps authors & contributors // SPDX-License-Identifier: Apache-2.0 import React from 'react'; import styled from 'styled-components'; interface Props { className?: string; value: string; } function Digits ({ className = '', value }: Props): React.ReactElement { return (
{value.split(',').map((parts, index) => (
{index !== 0 ? ',' : ''} {parts.split('').map((d, index) => (
{d}
))}
))}
); } export default React.memo(styled(Digits)` display: inline-block; white-space: nowrap; .group { display: inline-block; .digit { display: inline-block; text-align: center; width: 1ch; } } `);