/*
 * @Author: 赵伟
 * @Date: 2024-04-18 18:35:41
 * @Description: 实验状态
 */

import { ExperimentStatus } from '@/enums';
import { experimentStatusInfo as statusInfo } from '@/pages/Experiment/status';
import styles from './index.less';

function ExperimentStatusCell(status?: ExperimentStatus | null) {
  if (status === null || status === undefined || !statusInfo[status]) {
    return <span>--</span>;
  }
  return (
    <div className={styles['experiment-status-cell']}>
      <img
        style={{ width: '17px', marginRight: '7px' }}
        src={statusInfo[status]?.icon}
        draggable={false}
        alt=""
      />
      <span
        style={{ color: statusInfo[status]?.color }}
        className={styles['experiment-status-cell__label']}
      >
        {statusInfo[status]?.label}
      </span>
    </div>
  );
}

export default ExperimentStatusCell;
