chore: improved message for empty category

close: https://github.com/koreanbots/v2-testing/issues/100
This commit is contained in:
wonderlandpark 2021-05-16 20:36:47 +09:00
parent 8ca6d9ebae
commit 94be30b623
2 changed files with 3 additions and 3 deletions

View File

@ -1,7 +1,7 @@
import { NextPage } from 'next'
import { ErrorText } from '@utils/Constants'
const NotFound: NextPage = () => {
const NotFound: NextPage<{ message?: string }> = ({ message }) => {
return (
<div
className='flex items-center justify-center h-screen select-none text-center'
@ -13,7 +13,7 @@ const NotFound: NextPage = () => {
4
</div>
<h2 className='text-2xl font-semibold'>
{ErrorText[404]}
{message || ErrorText[404]}
</h2>
</div>

View File

@ -26,7 +26,7 @@ const Category: NextPage<CategoryProps> = ({ data, query }) => {
useEffect(() => {
setNSFW(localStorage.nsfw)
}, [])
if(!data || data.data.length === 0 || data.totalPage < Number(query.page)) return <NotFound />
if(!data || data.data.length === 0 || data.totalPage < Number(query.page)) return <NotFound message={data.data.length === 0 ? '해당 카테고리에 해당되는 봇이 존재하지 않습니다.' : null} />
return <>
<Hero header={`${query.category} 카테고리 봇들`} description={`다양한 "${query.category}" 카테고리의 봇들을 만나보세요.`} />
<SEO title={`${query.category} 카테고리 봇들`} description={`다양한 ${query.category} 카테고리의 봇들을 만나보세요.`} />