import React from 'react';
import { ReactComponent as Coffee } from '../../assets/images/coffee.svg';
import { ReactComponent as Infinity } from '../../assets/images/infinity.svg';
import styles from './VoteValue.module.css';

const VoteValue = ({ value, className }) => {
  const isInfinity = `${value}` === '9999';
  const isCoffee = `${value}` === '0';

  return (
    <div className={`${styles.voteValueContainer} ${className}`}>
      {isCoffee ? (
        <Coffee className={styles.coffee} />
      ) : isInfinity ? (
        <Infinity className={styles.infinity} />
      ) : (
        <div className={styles.value}>{value >= 0 ? value : ''}</div>
      )}
    </div>
  );
};

export default VoteValue;
