import React from 'react';
import { notFound } from 'next/navigation';
import { getCommunityPostById } from '@/lib/storage';
import CommunityPostDetailClient from './CommunityPostDetailClient';

export const revalidate = 0;

export default async function CommunityDetailPage({
  params,
}: {
  params: Promise<{ id: string }>;
}) {
  const resolvedParams = await params;
  const post = await getCommunityPostById(resolvedParams.id);
  if (!post) notFound();

  return <CommunityPostDetailClient post={post} />;
}
