import { InferGetStaticPropsType } from "next"; import Link from "next/link"; import { getAppRegistry } from "@calcom/app-store/_appRegistry"; import Shell from "@calcom/features/shell/Shell"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import { SkeletonText } from "@calcom/ui"; import { FiArrowLeft, FiArrowRight } from "@calcom/ui/components/icon"; export default function Apps({ categories }: InferGetStaticPropsType) { const { t, isLocaleReady } = useLocale(); return (
{isLocaleReady ? t("app_store") : }{" "}
{categories.map((category) => (

{category.name}

{t("number_apps", { count: category.count })}{" "}

))}
); } export const getStaticProps = async () => { const appStore = await getAppRegistry(); const categories = appStore.reduce((c, app) => { for (const category of app.categories) { c[category] = c[category] ? c[category] + 1 : 1; } return c; }, {} as Record); return { props: { categories: Object.entries(categories).map(([name, count]) => ({ name, count })), }, }; };