File size: 466 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import { Tooltip } from '@wordpress/components';
import { ComponentStatus, statuses } from './data';
import styles from './status-indicator.module.scss';

export const StatusIndicator = ( { status }: { status: ComponentStatus } ) => {
	const { label, icon } = statuses.find( ( s ) => s.value === status ) ?? {};

	return (
		<Tooltip text={ label }>
			<div className={ styles[ 'status-indicator' ] } aria-label={ label }>
				{ icon }
			</div>
		</Tooltip>
	);
};