"use client";

import Link from "next/link";
import { NAV } from "@/lib/nav";
import { Card, PageHeader } from "@/components/ui";

export default function DashboardHome() {
  const sections = NAV.filter((s) => s.label !== "میزکار");

  return (
    <div>
      <PageHeader
        title="خوش آمدید 👋"
        subtitle="از طریق بخش‌های زیر، محتوای اپلیکیشن آرام جان را مدیریت کنید."
      />
      <div className="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4">
        {sections.map((section) => {
          const Icon = section.icon;
          return (
            <Card key={section.label} className="flex flex-col gap-3">
              <div className="flex items-center gap-2">
                <span className="flex h-10 w-10 items-center justify-center rounded-xl bg-primary-soft text-primary">
                  <Icon className="h-5 w-5" />
                </span>
                <h2 className="font-bold text-foreground">{section.label}</h2>
              </div>
              <div className="flex flex-wrap gap-2">
                {section.items.map((item) => (
                  <Link
                    key={item.href}
                    href={item.href}
                    className="rounded-lg bg-surface-muted px-3 py-1.5 text-xs text-foreground transition hover:bg-primary-soft hover:text-primary"
                  >
                    {item.label}
                  </Link>
                ))}
              </div>
            </Card>
          );
        })}
      </div>
    </div>
  );
}
