import useDateFormat from "../../../../hooks/useDateFormat/index.js";
import classes from './styles.module.scss';
const NowLine = function NowLine(props) {
  const {
    currentTime,
    previousEvent,
    nextEvent
  } = props;
  const formattedTime = useDateFormat(currentTime, {
    format: '{h:m?} {P} {Z}'
  });
  if (!nextEvent || !previousEvent) {
    return null;
  }
  if (currentTime < new Date(previousEvent.date) || currentTime > new Date(nextEvent.date)) {
    return null;
  }
  return <div className={classes.nowLine}>
      <span className={classes.nowText}>
        Now
      </span>
      <div className={classes.line} />
      <span className={classes.timeStamp}>
        {formattedTime}
      </span>
    </div>;
};
export default NowLine;