19 lines
494 B
TypeScript
19 lines
494 B
TypeScript
import PostTable from "@/components/PostTable";
|
|
import { categoryCounts, readPosts } from "@/lib/store";
|
|
|
|
export const dynamic = "force-dynamic";
|
|
|
|
export default async function PostsPage() {
|
|
const { posts, revision } = await readPosts();
|
|
const sorted = [...posts].sort((a, b) => b.date.localeCompare(a.date));
|
|
return (
|
|
<main>
|
|
<PostTable
|
|
posts={sorted}
|
|
revision={revision}
|
|
categories={categoryCounts(posts).map((c) => c.name)}
|
|
/>
|
|
</main>
|
|
);
|
|
}
|