updated widgets

This commit is contained in:
2026-02-25 17:35:01 +09:00
parent 787724b09c
commit e4d2966377
43 changed files with 3648 additions and 180 deletions

View File

@@ -0,0 +1,34 @@
// app/[slug]/page.tsx
import Post from '@/components/Post/Post';
import { renderPostContent } from '@/components/WPRenderer/WPRenderer';
// ISR: regenerate every 60 seconds
export const revalidate = 60;
export interface PageProps {
params: {
slug: string;
};
}
export default async function PostPage({ params }: PageProps) {
const { slug } = await params;
const baseUrl =
process.env.NEXT_PUBLIC_API_URL || 'http://localhost:3000';
const res = await fetch(`${baseUrl}/api/posts/${slug}`, {
next: { revalidate: 60 },
});
if (!res.ok) {
console.log(`${baseUrl}/api/posts/${slug}`)
// 🚨 THROW — this is critical
throw new Error('Failed to fetch post');
}
const post = await res.json();
return (
<Post post={post} />
);
}