import React from 'react';
import style from './item.module.css';
import { Link } from 'gatsby';

interface ItemProps {
  to: string;
  title: string;
  subtitle?: string;
}

export default (props: ItemProps): JSX.Element => (
  <article className={style.projectItem}>
    <Link to={props.to}>
      <h3 className={style.projectTitle}>{props.title}</h3>
    </Link>
    <p className={style.projectSubtitle}>{props.subtitle}</p>
  </article>
);
