"use client";

import React from 'react';
import Link from 'next/link';
import { useRouter } from 'next/navigation';
import CourseForm from '@/components/admin/CourseForm';

export default function AdminCourseCreatePage() {
  const router = useRouter();
  return (
    <div className="p-6">
      <div className="flex items-center justify-between mb-6">
        <div>
          <h1 className="text-2xl font-bold text-gray-900">Buat Kursus Baru</h1>
          <p className="text-gray-600">Isi detail kursus kemudian simpan</p>
        </div>
        <Link href="/admin/courses" className="px-4 py-2 bg-gray-100 text-gray-700 rounded-lg hover:bg-gray-200">Kembali</Link>
      </div>
      <CourseForm mode="create" onDone={() => setTimeout(() => router.push('/admin/courses'), 600)} />
    </div>
  );
}