fix(market): Handle empty agents response (#8393)

* Fix issue where marketplace breaks if no agents are returned

* Fix issue where marketplace breaks if no agents are returned

* Remove supabase folder from tracking

* adding supabase submodule

---------

Co-authored-by: Aarushi <50577581+aarushik93@users.noreply.github.com>
pull/8428/head^2
Abhimanyu Yadav 2024-10-24 22:04:52 +05:30 committed by GitHub
parent 643c33456e
commit f3a4fd2a41
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 17 additions and 4 deletions

View File

@ -118,7 +118,7 @@ const AgentCard: React.FC<{ agent: Agent; featured?: boolean }> = ({
{agent.description}
</p>
<div className="mb-2 text-xs text-gray-400">
Categories: {agent.categories.join(", ")}
Categories: {agent.categories?.join(", ")}
</div>
</div>
<div className="flex items-end justify-between">
@ -315,14 +315,27 @@ const Marketplace: React.FC = () => {
)
) : (
<>
{featuredAgents.length > 0 && (
{featuredAgents?.length > 0 ? (
<AgentGrid
agents={featuredAgents}
title="Featured Agents"
featured={true}
/>
) : (
<div className="py-12 text-center">
<p className="text-gray-600">No Featured Agents found</p>
</div>
)}
<hr />
{topAgents?.length > 0 ? (
<AgentGrid agents={topAgents} title="Top Downloaded Agents" />
) : (
<div className="py-12 text-center">
<p className="text-gray-600">No Top Downloaded Agents found</p>
</div>
)}
<AgentGrid agents={topAgents} title="Top Downloaded Agents" />
<Pagination
page={topAgentsPage}
totalPages={topAgentsTotalPages}

View File

@ -9,4 +9,4 @@ ENABLE_AUTH=true
SUPABASE_JWT_SECRET=our-super-secret-jwt-token-with-at-least-32-characters-long
BACKEND_CORS_ALLOW_ORIGINS="http://localhost:3000,http://127.0.0.1:3000"
APP_ENV=local
APP_ENV=local