zero-gpu-spaces / app /page.tsx
enzostvs's picture
enzostvs HF staff
add dark theme
900e2e7
raw
history blame
517 Bytes
import { fetchAllPages } from "@/utils";
import { SpaceProps } from "@/utils/type";
import { Spaces } from "@/components/spaces";
export const revalidate = 120;
async function getSpaces(sort: string) {
try {
const response = await fetchAllPages(sort);
return response as SpaceProps[];
} catch {
return [];
}
}
export default async function Home({
searchParams: { sort },
}: {
searchParams: { sort: string };
}) {
const spaces = await getSpaces(sort);
return <Spaces spaces={spaces} />;
}