diff --git a/src/pages/SearchPage.tsx b/src/pages/SearchPage.tsx index 7952bbf..eafa94c 100644 --- a/src/pages/SearchPage.tsx +++ b/src/pages/SearchPage.tsx @@ -102,7 +102,7 @@ const SearchPage = () => { setIsTranslating(false); }; - const mods = data?.hits?.map((hit: any) => ({ + const modrinthMods = data?.modrinth?.hits?.map((hit: any) => ({ id: hit.project_id, slug: hit.slug, title: hit.title, @@ -112,8 +112,25 @@ const SearchPage = () => { followers: hit.follows, categories: hit.categories || [], 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 (