import React, { FC } from 'react';
import classNames from '@pansy/classnames';
import SensorIcon from '@sensoro/library/lib/components/sensor-icon';
import styles from './index.less';

interface AlarmSensorMarkerProps {
  category: string;
  isActive?: boolean;
}

// 传感器标记点
const SensorMarker: FC<AlarmSensorMarkerProps> = props => {
  const { category, isActive } = props;

  const className = classNames(
    {
      [styles.isActive]: isActive,
    },
    styles.isAlarm,
  );

  return (
    <div className={classNames(className, styles.marker)}>
      <div className={styles.outter} />
      <div className={styles.inner}>
        <SensorIcon type={category} />
      </div>
    </div>
  );
};

SensorMarker.defaultProps = {
  isActive: false,
};

export default SensorMarker;
