import { API_BASE } from '@/lib/config';

export async function generateStaticParams() {
  try {
    const res = await fetch(`${API_BASE}/courses`);
    const data = await res.json();
    const items = data.items || [];
    if (items.length === 0) return [{ id: '1' }];
    return items.map((c: any) => ({ id: String(c.id) }));
  } catch {
    return [{ id: '1' }];
  }
}

import CourseDetailClient from './client';

export default function CourseDetailPage() {
  return <CourseDetailClient />;
}
