mirror of
https://github.com/koreanbots/core.git
synced 2025-12-15 14:10:22 +00:00
chore: improved message for empty category
close: https://github.com/koreanbots/v2-testing/issues/100
This commit is contained in:
parent
8ca6d9ebae
commit
94be30b623
@ -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>
|
||||
|
||||
|
||||
@ -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} 카테고리의 봇들을 만나보세요.`} />
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user