aaronjy-me/src/components/StaticContentList/StaticContentList.jsx
2025-05-03 15:44:10 +01:00

19 lines
539 B
JavaScript

import { formatDate } from '@/lib/helpers'
import Link from 'next/link'
export default function StaticContentList ({ entries, urlPrefix, max = 0 }) {
return (
<table>
<tbody>
{entries.map((e) => (
<tr key={e.slug}>
<td>{!!e.datePublished && <span>{formatDate(e.datePublished)}</span>}</td>
<td>
<Link href={`${urlPrefix}${e.slug}`}>{e.title}</Link>
</td>
</tr>
)).slice(0, max > 0 ? max : entries.length)}
</tbody>
</table>
)
}