import { CandidatePolarity } from "../../index.js";
import { useCandidateMetadata } from "../../../../hooks/election/index.js";
// import { useMemo } from 'react';
import classnames from 'classnames';
import classes from './styles.module.scss';
import typography from '../typography.module.scss';
const PolarityTag = function PolarityTag(props) {
  const {
    candidateId
  } = props;
  const meta = useCandidateMetadata(candidateId);
  const {
    polarity
  } = meta;
  if (polarity === undefined) {
    return null;
  }
  return <span className={classnames(classes.container, typography.tag)}>
      <CandidatePolarity id={candidateId} />
    </span>;
};
export default PolarityTag;