mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-04-26 20:08:29 -04:00
24 lines
524 B
TypeScript
24 lines
524 B
TypeScript
import Link from "next/link";
|
|
import { format, parseISO } from "date-fns";
|
|
|
|
import styles from "./ListItem.module.scss";
|
|
|
|
export type Props = {
|
|
title: string;
|
|
date: string;
|
|
slug: string;
|
|
};
|
|
|
|
export default function ListItem({ title, date, slug }: Props) {
|
|
return (
|
|
<li className={styles.row}>
|
|
<span className={styles.date}>{format(parseISO(date), "MMM d")}</span>
|
|
<span>
|
|
<Link href={`/notes/${slug}/`} prefetch={false}>
|
|
<a>{title}</a>
|
|
</Link>
|
|
</span>
|
|
</li>
|
|
);
|
|
}
|