/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: MIT-0 */ import { FunctionComponent } from 'react' import { Box, Text } from 'aws-northstar' import { KeyValuePairProps as NSKeyValuePairProps } from 'aws-northstar/components/KeyValuePair' import { InfoPopover, InfoPopoverProps } from '../../InfoPopover' type KeyValuePairProps = NSKeyValuePairProps & InfoPopoverProps export const KeyValuePair: FunctionComponent = ({ infoKey, infoHeader, infoValues, infoPopoverVariant, ...keyValuePairProps }) => { const { label, value } = keyValuePairProps let infoPopover = null if (infoKey != null || infoValues != null) { infoPopover = ( ) } return ( {label} {infoPopover} {!value ? ( - ) : typeof value === 'string' || typeof value === 'number' ? ( {value} ) : ( <>{value} )} ) }