import React from 'react';
import { projectItem, projectSubtitle, projectTitle } from './item.module.css';
import { Link } from 'gatsby';

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

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