-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
44e297a
commit 5faad28
Showing
3 changed files
with
78 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import { getAllNotices } from '@/api/notice/notice'; | ||
import ResultZabo from '@/app/components/templates/ResultZabo/ResultZabo'; | ||
import { createTranslation } from '@/app/i18next'; | ||
import { Locale } from '@/app/i18next/settings'; | ||
|
||
import SearchNoResult from './assets/searchNoResult.svg'; | ||
|
||
const Result = async ({ | ||
lng, | ||
...props | ||
}: { | ||
lng: Locale; | ||
search: string; | ||
tags: string[]; | ||
offset: number; | ||
limit: number; | ||
}) => { | ||
const { t } = await createTranslation(lng, 'translation'); | ||
const data = await getAllNotices(props); | ||
return ( | ||
<> | ||
{data?.list.length !== 0 && ( | ||
<div className="gap-[10px] flex flex-col flex-nowrap"> | ||
<p className="text-lg md:text-4xl font-bold"> | ||
{t('searchPage.title')} | ||
</p> | ||
|
||
<div className="h-8" /> | ||
|
||
{data.list.map((notice) => ( | ||
<ResultZabo | ||
{...notice} | ||
searchQuery={props.search} | ||
logName="SearchPage" | ||
key={notice.id} | ||
/> | ||
))} | ||
</div> | ||
)} | ||
|
||
{props.search && data.list.length === 0 && ( | ||
<div className="flex justify-center w-full"> | ||
<div className="flex justify-center flex-col align-center"> | ||
<div className="h-[100px]" /> | ||
<div style={{ height: '10px', margin: '0 auto' }}></div> | ||
|
||
<SearchNoResult /> | ||
|
||
<p className="text-center text-secondaryText font-bold font-lg md:font-2xl pt-5"> | ||
{t('searchPage.noResult')} | ||
</p> | ||
</div> | ||
</div> | ||
)} | ||
</> | ||
); | ||
}; | ||
|
||
export default Result; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters