import Link from "next/link"; import { useId } from "react"; import { cn } from "@/lib/utils"; import { IconLink } from "./changelog-layout"; import { BookIcon, GitHubIcon, XIcon } from "./icons"; import { DiscordLogoIcon } from "@radix-ui/react-icons"; import { StarField } from "./stat-field"; import { betterFetch } from "@better-fetch/fetch"; import Markdown from "react-markdown"; import defaultMdxComponents from "fumadocs-ui/mdx"; import rehypeHighlight from "rehype-highlight"; import "highlight.js/styles/dark.css"; export const dynamic = "force-static"; const ChangelogPage = async () => { const { data: releases } = await betterFetch< { id: number; tag_name: string; name: string; body: string; html_url: string; prerelease: boolean; published_at: string; }[] >("https://api.github.com/repos/better-auth/better-auth/releases"); const messages = releases ?.filter((release) => !release.prerelease) .map((release) => ({ tag: release.tag_name, title: release.name, content: getContent(release.body), date: new Date(release.published_at).toLocaleDateString("en-US", { year: "numeric", month: "short", day: "numeric", }), url: release.html_url, })); function getContent(content: string) { const lines = content.split("\n"); const newContext = lines.map((line) => { if (line.startsWith("- ")) { const mainContent = line.split(";")[0]; const context = line.split(";")[2]; const mentions = context ?.split(" ") .filter((word) => word.startsWith("@")) .map((mention) => { const username = mention.replace("@", ""); const avatarUrl = `https://github.com/${username}.png`; return `[](https://github.com/${username})`; }); if (!mentions) { return line; } // Remove   return mainContent.replace(/ /g, "") + " – " + mentions.join(" "); } return line; }); return newContext.join("\n"); } return (
Better Auth is comprehensive authentication library for TypeScript that provides a wide range of features to make authentication easier and more secure.
{props.children?.toString().includes("date=") && props.children?.toString().split("date=")[1]}
), h3: (props) => (