2024-01-15 12:33:15 +00:00
|
|
|
import { ArticleLinks } from '@/types/content-types'
|
|
|
|
import Link from 'next/link'
|
|
|
|
import { Icon } from './Icon'
|
|
|
|
|
2024-05-22 15:55:49 +00:00
|
|
|
interface ArticleNavLinksProps {
|
2024-01-15 12:33:15 +00:00
|
|
|
links: ArticleLinks
|
|
|
|
}
|
|
|
|
|
|
|
|
export async function ArticleNavLinks({ links: { prev, next } }: ArticleNavLinksProps) {
|
|
|
|
return (
|
|
|
|
<div className="article__links">
|
|
|
|
{prev && (
|
|
|
|
<Link href={prev.path ?? '/'} className="article__links__link article__links__prev">
|
|
|
|
<Icon icon="arrow-left" />
|
|
|
|
<span>{prev.title}</span>
|
|
|
|
</Link>
|
|
|
|
)}
|
|
|
|
{next && (
|
|
|
|
<Link href={next.path ?? '/'} className="article__links__link article__links__next">
|
|
|
|
<span>{next.title}</span>
|
|
|
|
<Icon icon="arrow-right" />
|
|
|
|
</Link>
|
|
|
|
)}
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|