delete api pages

This commit is contained in:
SwiftyOS
2024-11-13 09:58:45 +01:00
parent d17ea2d62a
commit 760e2ff592
2 changed files with 0 additions and 54 deletions

View File

@@ -1,10 +0,0 @@
export interface FeaturedAgent {
agentName: string;
agentImage: string;
creatorName: string;
description: string;
runs: number;
rating: number;
}
export type FeaturedAgents = FeaturedAgent[];

View File

@@ -1,44 +0,0 @@
import type { FeaturedAgents } from "./featuredAgents";
export async function getFeaturedAgents(): Promise<FeaturedAgents> {
if (!process.env.NEXT_PUBLIC_AGPT_SERVER_URL) {
throw new Error("NEXT_PUBLIC_AGPT_SERVER_URL is not set!");
}
try {
const res = await fetch(
`${process.env.NEXT_PUBLIC_AGPT_SERVER_URL}/featured-agents`,
);
if (!res.ok) {
// Render the closest `error.js` Error Boundary
throw new Error("Something went wrong while fetching featured agents!");
}
const featuredAgents = (await res.json()) as FeaturedAgents;
return featuredAgents;
} catch (error) {
console.error("Error fetching featured agents:", error);
return [
{
agentName: "Super SEO Optimizer",
agentImage:
"https://ddz4ak4pa3d19.cloudfront.net/cache/cc/11/cc1172271dcf723a34f488a3344e82b2.jpg",
creatorName: "AI Labs",
description:
"Boost your website's search engine rankings with our advanced AI-powered SEO optimization tool.",
runs: 100000,
rating: 4.9,
},
{
agentName: "Content Wizard",
agentImage:
"https://upload.wikimedia.org/wikipedia/commons/c/c5/Big_buck_bunny_poster_big.jpg",
creatorName: "WriteRight Inc.",
description:
"Generate high-quality, engaging content for your blog, social media, or marketing campaigns.",
runs: 75000,
rating: 4.7,
},
];
}
}