Spaces:
Running
Running
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} />; | |
} | |