import { Badge } from './leafygreen'; import { css } from '@leafygreen-ui/emotion'; import { spacing } from '@leafygreen-ui/tokens'; import React from 'react'; import IndexIcon from './index-icon'; import { Variant as BadgeVariant } from '@leafygreen-ui/badge'; const keyListStyles = css({ display: 'inline-flex', gap: spacing[1], }); const badgeStyles = css({ // Override LeafyGreen's uppercase styles as we want to keep the case sensitivity of the key. textTransform: 'none', gap: spacing[1], }); type KeyListProps = { keys: { field: string; value: any }[]; 'data-testid'?: string; }; const IndexBadge: React.FunctionComponent<{ field: string; value: unknown; }> = ({ field, value }) => { return ( {field} ); }; const IndexKeysBadge: React.FunctionComponent = ({ keys, 'data-testid': testId, }) => { return (
{keys.map(({ field, value }) => ( {field} ))}
); }; export { IndexKeysBadge, IndexBadge };