File size: 860 Bytes
1b72d7e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import Link from 'next/link'

/**
 * 上一篇,下一篇文章
 * @param {prev,next} param0
 * @returns
 */
export default function BlogAround ({ prev, next }) {
  if (!prev || !next) {
    return <></>
  }
  return (
    <section className='text-gray-800 border-t dark:text-gray-300 flex flex-wrap lg:flex-nowrap lg:space-x-10 justify-between py-2'>
      {prev && <Link
        href={`/${prev.slug}`}
        passHref
        className='text-sm py-3 text-gray-500 hover:underline cursor-pointer'>

        <i className='mr-1 fas fa-angle-double-left' />{prev.title}

      </Link>}
      {next && <Link
        href={`/${next.slug}`}
        passHref
        className='text-sm flex py-3 text-gray-500 hover:underline cursor-pointer'>
        {next.title}
        <i className='ml-1 my-1 fas fa-angle-double-right' />

      </Link>}
    </section>
  );
}