diff --git a/src/app/(landing)/page.tsx b/src/app/(landing)/page.tsx index d8eff54..c91b070 100644 --- a/src/app/(landing)/page.tsx +++ b/src/app/(landing)/page.tsx @@ -14,6 +14,7 @@ import { type Metadata } from "next"; import LsLogo from "./ls-logo"; import { Button } from "~/components/ui/button"; +import { Badge } from "~/components/ui/badge"; import { Tabs, TabsList, TabsTrigger, TabsContent } from "~/components/ui/tabs"; import Link from "next/link"; import { Terminal } from "lucide-react"; @@ -23,6 +24,7 @@ import Image from "next/image"; import VideoComponent from "./video-component"; import CloneRepoBadge from "./clone-repo-badge"; +import { format } from "date-fns"; export const metadata: Metadata = { title: "Cascade - free open-source SaaS boilerplate", @@ -79,7 +81,27 @@ const Logos = () => { ); }; -export default function Home() { +export default async function Home() { + const stargazersQuery = await fetch( + `https://api.github.com/repos/d-ivashchuk/cascade`, + { + next: { revalidate: 60 }, + }, + ); + const lastCommitQuery = await fetch( + `https://api.github.com/repos/d-ivashchuk/cascade/commits`, + { + next: { revalidate: 60 }, + }, + ); + + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment + const stargazersData: { stargazers_count: number } = + await stargazersQuery.json(); + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment + const lastCommitData: { commit: { committer: { date: string } } }[] = + await lastCommitQuery.json(); + return (

Cascade

-

- Free and open-source SaaS boilerplate.
Start writing - your business logic from day 1. +

+ Free and open-source SaaS boilerplate.

+ {lastCommitData[0] && ( + +
+ Last updated on{" "} + {format(new Date(lastCommitData[0].commit.committer.date), "PP")} + + )}
+