Preceding changes
This commit is contained in:
parent
c9f1569dc4
commit
111b2048e3
@ -102,7 +102,7 @@ const SearchPage = () => {
|
|||||||
setIsTranslating(false);
|
setIsTranslating(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
const mods = data?.hits?.map((hit: any) => ({
|
const modrinthMods = data?.modrinth?.hits?.map((hit: any) => ({
|
||||||
id: hit.project_id,
|
id: hit.project_id,
|
||||||
slug: hit.slug,
|
slug: hit.slug,
|
||||||
title: hit.title,
|
title: hit.title,
|
||||||
@ -112,8 +112,25 @@ const SearchPage = () => {
|
|||||||
followers: hit.follows,
|
followers: hit.follows,
|
||||||
categories: hit.categories || [],
|
categories: hit.categories || [],
|
||||||
project_type: hit.project_type,
|
project_type: hit.project_type,
|
||||||
|
source: "modrinth" as const,
|
||||||
})) || [];
|
})) || [];
|
||||||
|
|
||||||
|
const cfMods = data?.curseforge?.data?.map((mod: any) => ({
|
||||||
|
id: String(mod.id),
|
||||||
|
slug: String(mod.id),
|
||||||
|
title: mod.name,
|
||||||
|
description: mod.summary,
|
||||||
|
icon_url: mod.logo?.url,
|
||||||
|
downloads: mod.downloadCount,
|
||||||
|
followers: mod.thumbsUpCount || 0,
|
||||||
|
categories: mod.categories?.map((c: any) => c.name) || [],
|
||||||
|
project_type: "mod",
|
||||||
|
source: "curseforge" as const,
|
||||||
|
})) || [];
|
||||||
|
|
||||||
|
const mods = [...modrinthMods, ...cfMods];
|
||||||
|
const totalHits = (data?.modrinth?.total_hits || 0) + (data?.curseforge?.pagination?.totalCount || 0);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex min-h-screen flex-col">
|
<div className="flex min-h-screen flex-col">
|
||||||
<Navbar />
|
<Navbar />
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user