import { notFound } from 'next/navigation';
import { getPageData, getAllSlugs } from "@/utils/data";

export default async function PresentationPage({ params }) {
  const resolvedParams = await params;
  const slugArr = resolvedParams.slug;

  const { data, error } = await getPageData({
    slug_list: slugArr,
    downloadFiles: true
  });

  if (error || !data) {
    notFound();
  }

  // PPT展示页面 - 全屏展示
  return (
    <div className="min-h-screen bg-black">
      <div className="w-full h-screen flex items-center justify-center">
        <div className="w-full h-full relative">
          <div className="absolute inset-0 bg-black bg-opacity-40 flex items-center justify-center">
            <div className="text-center text-white max-w-4xl mx-auto px-8">
              {data.content && (
                <div className="text-lg md:text-xl mb-8 leading-relaxed" 
                     dangerouslySetInnerHTML={{ __html: data.content }} />
              )}
            </div>
          </div>
        </div>
      </div>
    </div>
  );
}
