2023-04-17 17:06:41 +02:00
|
|
|
import React from 'react';
|
|
|
|
import PropTypes from 'prop-types';
|
2023-07-18 17:15:25 +02:00
|
|
|
import { Label, Text } from '../../component-library';
|
|
|
|
|
2023-04-17 17:06:41 +02:00
|
|
|
import {
|
2023-05-08 19:28:46 +02:00
|
|
|
TextTransform,
|
2023-04-17 17:06:41 +02:00
|
|
|
BackgroundColor,
|
|
|
|
TextColor,
|
2023-05-08 19:28:46 +02:00
|
|
|
FontWeight,
|
2023-04-17 17:06:41 +02:00
|
|
|
BorderRadius,
|
2023-07-13 18:27:49 +02:00
|
|
|
TextVariant,
|
2023-04-17 17:06:41 +02:00
|
|
|
} from '../../../helpers/constants/design-system';
|
|
|
|
|
|
|
|
const CustodyLabels = (props) => {
|
|
|
|
const { labels, index, background, hideNetwork } = props;
|
|
|
|
const filteredLabels = hideNetwork
|
|
|
|
? labels.filter((item) => item.key !== 'network_name')
|
|
|
|
: labels;
|
|
|
|
|
|
|
|
return (
|
|
|
|
<Label
|
|
|
|
display={['flex']}
|
|
|
|
flexDirection={['row']}
|
|
|
|
htmlFor={`address-${index || 0}`}
|
|
|
|
>
|
|
|
|
{filteredLabels.map((item) => (
|
|
|
|
<Text
|
|
|
|
key={item.key}
|
2023-07-13 18:27:49 +02:00
|
|
|
textTransform={TextTransform.Capitalize}
|
2023-04-17 17:06:41 +02:00
|
|
|
className="custody-label"
|
|
|
|
style={background ? { background } : {}}
|
|
|
|
marginTop={1}
|
|
|
|
marginRight={1}
|
|
|
|
marginBottom={2}
|
|
|
|
paddingTop={1}
|
|
|
|
paddingBottom={1}
|
|
|
|
paddingLeft={2}
|
|
|
|
paddingRight={2}
|
|
|
|
backgroundColor={BackgroundColor.backgroundAlternative}
|
2023-07-13 18:27:49 +02:00
|
|
|
color={TextColor.textDefault}
|
2023-05-08 19:28:46 +02:00
|
|
|
fontWeight={FontWeight.Normal}
|
2023-04-17 17:06:41 +02:00
|
|
|
borderRadius={BorderRadius.SM}
|
2023-07-13 18:27:49 +02:00
|
|
|
variant={TextVariant.bodyXs}
|
2023-04-17 17:06:41 +02:00
|
|
|
>
|
|
|
|
{item.value}
|
|
|
|
</Text>
|
|
|
|
))}
|
|
|
|
</Label>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
CustodyLabels.propTypes = {
|
|
|
|
labels: PropTypes.array,
|
|
|
|
index: PropTypes.string,
|
|
|
|
background: PropTypes.string,
|
|
|
|
hideNetwork: PropTypes.bool,
|
|
|
|
};
|
|
|
|
|
|
|
|
export default CustodyLabels;
|