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

interface BuildingMarkerProps {
  info: DeviceInfo;
  onClick?: (info: DeviceInfo) => void;
}

const BuildingMarker: FC<BuildingMarkerProps> = props => {
  const { info } = props;

  return (
    <div
      className={classNames(styles.marker, {
        [`${styles.offline}`]: info.status === 0,
      })}
    >
      <SensorIcon type={iconMap[info?.deviceUsageType]} />

      {info.selected && <Selected className={styles.selected} />}
    </div>
  );
};

export default BuildingMarker;
