import { useNowInterval, useFormattedTimestamp } from "../../../../hooks/time/index.js";
import classes from './styles.module.scss';
const TimeStamp = function TimeStamp(props) {
  const {
    eventTime
  } = props;
  const currentTime = useNowInterval(60000);
  const timeDifference = useFormattedTimestamp(eventTime, {
    allowFuture: true
  });
  const closingText = currentTime > new Date(eventTime) ? 'Polls closed' : 'Polls closing';
  return <div>
      <p className={classes.timestampText}>
        {closingText}
        {' '}
        {timeDifference}
      </p>
    </div>;
};
export default TimeStamp;