'use client';

import { useState } from 'react';
import ProvinsiMahasiswaPieChart from "@/components/chartsDashboard/ProvinsiMahasiswaPieChart";
import FilterTahunAngkatan from "@/components/FilterTahunAngkatan";
import TabelAsalProvinsiMahasiswa from "@/components/chartstable/tabelasalprovinsi mahasiswa";

export default function AsalProvinsiDetailPage() {
  const [selectedYear, setSelectedYear] = useState<string>('all');

  return (
    <div className="min-h-screen bg-gray-50 dark:bg-[var(--background)] p-4">
      <div className="container mx-auto max-w-7xl space-y-2">
        {/* Chart Section - Enhanced Size */}
        <div className="grid grid-cols-1 lg:grid-cols-1 gap-6">
          {/* Asal Provinsi Chart dengan ukuran lebih besar */}
          <div className="lg:col-span-2">
            <ProvinsiMahasiswaPieChart 
              height="h-[400px] sm:h-[400px] lg:h-[400px]"
              showDetailButton={false}
            />
          </div>
        </div>

        {/* Filter Section */}
        <div className="bg-white dark:bg-slate-900 rounded-lg shadow-sm p-4">
          <FilterTahunAngkatan 
            selectedYear={selectedYear} 
            onYearChange={setSelectedYear}
          />
        </div>

        {/* Table Section */}
        <TabelAsalProvinsiMahasiswa selectedYear={selectedYear} />

        {/* Information Section */}
        <div className="bg-white dark:bg-slate-900 rounded-lg shadow-sm p-6">
          <h2 className="text-xl font-semibold text-gray-900 dark:text-white mb-4">
            Informasi Visualisasi
          </h2>
          <div className="grid md:grid-cols-2 gap-6">
            <div>
              <h3 className="font-medium text-gray-900 dark:text-white mb-2">
                Grafik Asal Provinsi Mahasiswa
              </h3>
              <ul className="text-sm text-gray-600 dark:text-gray-300 space-y-1">
                <li>• Menampilkan proporsi mahasiswa berdasarkan provinsi kalimantan barat dengan luar kalimantan barat</li>
              </ul>
            </div>
          </div>
          
        </div>
      </div>
    </div>
  );
}
