Free & Open-Source Invoice Generator - No Sign-Up, No Ads, Instant PDF Export, 100% In-Browser, and Fully Customizable Templates.
TypeScript fintechinvoiceinvoice-generatorinvoice-pdfinvoice-templateinvoicesnextjsopen-sourcequotesreactreact-pdf-rendererself-hostedshadcn-uitailwindcsstypescript
import Link from "next/link";
import { notFound } from "next/navigation";
import { Suspense } from "react";
import {
formatChangelogDate,
getChangelogEntries,
type ChangelogEntry,
} from "@/app/(main)/changelog/utils";
import { ChangelogAuthorByline } from "./components/changelog-author-byline";
import { ChangelogVersionBadgeLink } from "./components/changelog-version-badge-link";
import { DateTime } from "./components/date-time";
// https://nextjs.org/docs/app/guides/mdx
/**
* Changelog page component that displays all changelog entries in a timeline layout.
* Fetches and renders changelog entries with dates, titles, and content.
* Returns 404 if no entries are found.
*
* @returns The changelog page with all entries
*/
export default async function ChangelogPage() {
const entries = await getChangelogEntries();
if (entries.length === 0) {
notFound();
}
return (
<div className="min-h-screen bg-white dark:bg-gray-900">
{/* Blur transition overlay between header and hero */}
<div
data-info="blur-transition-overlay"
className="pointer-events-none absolute left-0 right-0 top-[25px] h-24 bg-gradient-to-b from-slate-100 to-slate-50 blur-2xl"
/>
<div className="relative z-0">
<div className="relative mb-8 pt-16 text-center sm:mb-16">
<div className="absolute bottom-0 h-full w-full bg-[radial-gradient(#e5e7eb_1px,transparent_1px)] [background-size:16px_16px] [mask-image:radial-gradient(ellipse_50%_50%_at_50%_50%,#000_70%,transparent_100%)] sm:bottom-auto"></div>
<h1 className="relative z-10 text-4xl font-bold tracking-tight text-gray-900 dark:text-gray-100 sm:text-5xl">
Changelog
</h1>
<p className="relative z-10 mt-4 text-balance px-4 text-lg text-gray-600 dark:text-gray-400 sm:px-0">
All the latest updates, improvements, and fixes to EasyInvoicePDF
</p>
</div>
{/* Timeline Grid */}
<div className="border-slate-200 sm:border-t">
<div className="mx-auto max-w-6xl border-slate-200 px-4 dark:border-gray-700 sm:px-12 xl:border-x">
{entries.map((entry) => {
return <ChangelogEntryCard key={entry.slug} entry={entry} />;
})}
</div>
</div>
</div>
</div>
);
}
/**
* Renders a single changelog entry card with date, title, and content.
* On desktop, the date is sticky in the left column. On mobile, it appears above the title.
*
* @param entry - The changelog entry to display
*/
function ChangelogEntryCard({ entry }: { entry: ChangelogEntry }) {
const formattedDate = formatChangelogDate(entry.metadata.date);
return (
<div className="grid pb-20 pt-4 sm:pt-12 md:grid-cols-4">
{/* Sticky Date Column - Desktop Only */}
<div className="sticky top-28 hidden self-start md:col-span-1 md:mt-[6px] md:block">
<Link href={`/changelog/${entry.slug}`}>
<DateTime dateTime={entry.metadata.date}>{formattedDate}</DateTime>
</Link>
</div>
{/* Content Column */}
<div className="flex flex-col md:col-span-3">
{/* Mobile Date - Above Title */}
<Link className="mb-3 md:hidden" href={`/changelog/${entry.slug}`}>
<DateTime dateTime={entry.metadata.date}>{formattedDate}</DateTime>
</Link>
{/* Title */}
<Link href={`/changelog/${entry.slug}`}>
<h2 className="mt-2 text-pretty text-2xl font-semibold tracking-tight text-gray-800 hover:underline hover:decoration-1 hover:underline-offset-4 dark:text-gray-100 sm:mt-0">
{entry.metadata.title || `Update ${formattedDate}`}
</h2>
</Link>
{/* Version Badge */}
{entry.metadata.version ? (
<div className="mt-2 flex items-center gap-2">
<ChangelogVersionBadgeLink version={entry.metadata.version} />
</div>
) : null}
<div className="not-prose mb-2 mt-4">
<ChangelogAuthorByline />
</div>
{/* Article Content */}
<article
data-testid="changelog-entry-card"
className="prose prose-gray max-w-none transition-all dark:prose-invert prose-headings:relative prose-headings:mb-4 prose-headings:mt-6 prose-headings:scroll-mt-20 prose-headings:font-semibold prose-headings:text-gray-900 prose-h1:text-2xl prose-h2:text-xl prose-h3:text-lg prose-h4:text-base prose-p:leading-relaxed prose-p:text-gray-600 prose-a:font-medium prose-a:text-blue-600 prose-a:underline-offset-4 hover:prose-a:text-blue-600/80 prose-strong:text-gray-900 prose-pre:border prose-pre:border-gray-200 prose-pre:bg-gray-100 prose-li:text-gray-600 prose-img:rounded-lg prose-img:border prose-img:border-gray-200 prose-img:shadow-md dark:prose-headings:text-gray-100 dark:prose-p:text-gray-300 dark:prose-a:text-blue-400 dark:prose-strong:text-gray-100 dark:prose-pre:border-gray-700 dark:prose-pre:bg-gray-800 dark:prose-li:text-gray-300 dark:prose-img:border-gray-700"
>
<Suspense
fallback={
<div className="h-32 animate-pulse rounded bg-gray-200 dark:bg-gray-700"></div>
}
>
<entry.Component />
</Suspense>
</article>
</div>
</div>
);
}