diff --git a/src/app/search/page.js b/src/app/search/page.js index 3774109..88b5ac4 100644 --- a/src/app/search/page.js +++ b/src/app/search/page.js @@ -4,6 +4,7 @@ import prisma from "@/models/db"; import Items from "@/components/list/Items"; import REACH from "@/config/reach"; import Form from "./form"; +import Alert from "@/components/Alert"; export default async function Page({ searchParams }) { const query = { @@ -57,35 +58,46 @@ export default async function Page({ searchParams }) {
- ({ - id: user.username, - image: user.image, - url: `/${user.username}`, - urlText: user.name, - description: user.bio, - socials: user.platforms.map((platform) => ({ - icon: platform.name, - })), - meta: [ - // biggest reach - { - icon: WifiIcon, - text: `Reach ${ - REACH().data[ - REACH().sortByLargest(user.platforms)[0].reach - ].group - }`, - }, - // lowest price - { - icon: ArrowUpIcon, - text: `From $${user.platforms[0].price}`, - }, - ], - tags: user.tags?.split(","), - }))} - /> + {users.length > 0 ? ( + ({ + id: user.username, + image: user.image, + url: `/${user.username}`, + urlText: user.name, + description: user.bio, + socials: user.platforms.map((platform) => ({ + icon: platform.name, + })), + meta: [ + // biggest reach + { + icon: WifiIcon, + text: `Reach ${ + REACH().data[ + REACH().sortByLargest(user.platforms)[0].reach + ].group + }`, + }, + // lowest price + { + icon: ArrowUpIcon, + text: `From $${user.platforms[0].price}`, + }, + ], + tags: user.tags?.split(","), + }))} + /> + ) : ( + + )}