文章空列表跳转处理

This commit is contained in:
tangly1024
2021-10-20 13:47:31 +08:00
parent a4f3c6f1ec
commit 8a700c32eb

View File

@@ -1,12 +1,21 @@
import { useRouter } from 'next/router'
import { useEffect } from 'react'
/**
* 空白博客 列表
* @returns {JSX.Element}
* @constructor
*/
const BlogPostListEmpty = () => {
const router = useRouter()
useEffect(() => {
setTimeout(() => {
router.push('/')
}, 3000)
})
return <div className='w-full h-full flex justify-center mx-auto'>
<div className='align-middle text-center my-auto'>
<p className='text-gray-500 dark:text-gray-300'>No posts found.</p>
<p className='text-gray-500 dark:text-gray-300'>没有文章了3秒后返回首页</p>
</div>
</div>
}