import styles from "./newsletteritem.module.scss"

type NewsletterItemProps = {
  title: string;
  pubDate: string;
  link: string
}

export const NewsletterItem = ({title, pubDate, link}: NewsletterItemProps) => {
  const date = new Date(pubDate);

  return (
    <div>
      <div className={styles.date}>{date.toLocaleDateString()}</div>
      <div>
        <a
          className={styles.title}
          href={link} target={"_blank"}>{title}</a>
      </div>
    </div>
  )
}