import { Fragment } from 'react'; import { FiChevronsRight } from 'react-icons/fi'; import styles from './MetadataViewer.module.css'; interface Props { onFollowPath: (value: string) => void; value: unknown; } function AttributeLink(props: Props) { const { onFollowPath, value } = props; if (Array.isArray(value)) { return (
[ {value.map((val, i) => ( // eslint-disable-next-line react/no-array-index-key {i < value.length - 1 && ,} ))} ]
); } if (typeof value === 'string' && value !== '.') { return ( ); } return <>{JSON.stringify(value)}; } export default AttributeLink;