import { Head, usePage } from '@inertiajs/react';
import AppLayout from '@/layouts/app-layout';

export default function Dashboard() {
    const { auth } = usePage().props as any;

    return (
        <AppLayout>
            <Head title="Portal Karyawan" />
            
            <div className="flex flex-1 flex-col gap-4 p-4 md:p-8">
                <div className="flex flex-col gap-2">
                    <h1 className="text-3xl font-bold">Halo, {auth.user.name}!</h1>
                    <p className="text-muted-foreground italic">
                        Selamat datang di portal SDM. Kamu login sebagai <span className="font-bold text-foreground underline">{auth.user.role}</span>.
                    </p>
                </div>

                <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4">
                    {/* Kotak-kotak info simpel untuk karyawan */}
                    <div className="p-6 bg-white border rounded-xl shadow-sm space-y-2">
                        <p className="text-xs font-bold text-zinc-400 uppercase">Email</p>
                        <p className="font-medium">{auth.user.email}</p>
                    </div>
                    <div className="p-6 bg-white border rounded-xl shadow-sm space-y-2">
                        <p className="text-xs font-bold text-zinc-400 uppercase">Status Akun</p>
                        <p className="font-medium text-green-600">Aktif</p>
                    </div>
                </div>
            </div>
        </AppLayout>
    );
}