import Link from "next/link";
import {
  ArrowRight,
  Home,
  Info,
  Cpu,
  FolderKanban,
  GraduationCap,
  Users,
  Newspaper,
  Phone,
  Wrench,
} from "lucide-react";

const PAGES = [
  {
    slug: "home",
    label: "Home",
    description: "Hero video, headings, CTA buttons",
    icon: Home,
    path: "/",
  },
  {
    slug: "about",
    label: "About",
    description: "Hero, body text, stats and CTA",
    icon: Info,
    path: "/about",
  },
  {
    slug: "services",
    label: "Services",
    description: "Hero image and section headings",
    icon: Wrench,
    path: "/services",
  },
  {
    slug: "projects",
    label: "Projects",
    description: "Hero image and page copy",
    icon: FolderKanban,
    path: "/projects",
  },
  {
    slug: "technologies",
    label: "Technologies",
    description: "Hero image and page copy",
    icon: Cpu,
    path: "/technologies",
  },
  {
    slug: "training",
    label: "Training",
    description: "Hero image and page copy",
    icon: GraduationCap,
    path: "/training",
  },
  {
    slug: "clients",
    label: "Clients",
    description: "Hero image and page copy",
    icon: Users,
    path: "/clients",
  },
  {
    slug: "inspectors",
    label: "Inspectors",
    description: "Hero and listing copy for the inspectors marketplace",
    icon: Users,
    path: "/inspectors",
  },
  {
    slug: "news",
    label: "News",
    description: "Hero image and page copy",
    icon: Newspaper,
    path: "/news",
  },
  {
    slug: "contact",
    label: "Contact",
    description: "Hero image and business hours",
    icon: Phone,
    path: "/contact",
  },
];

export default function PagesAdmin() {
  return (
    <div className="p-6 lg:p-8 max-w-7xl mx-auto space-y-8">
      <div>
        <h1 className="text-2xl font-bold tracking-tight text-foreground">Pages</h1>
        <p className="text-sm text-muted-foreground mt-1">
          Edit hero content, page copy, and SEO settings for each public page.
        </p>
      </div>

      <div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4">
        {PAGES.map(({ slug, label, description, icon: Icon, path }) => (
          <Link
            key={slug}
            href={`/admin/pages/${slug}`}
            className="group flex items-start gap-4 bg-card border border-border rounded-lg p-5 hover:border-accent/40 hover:shadow-sm transition-all"
          >
            <div className="mt-0.5 flex h-9 w-9 shrink-0 items-center justify-center rounded-md bg-muted group-hover:bg-accent/10 transition-colors">
              <Icon className="h-4 w-4 text-muted-foreground group-hover:text-accent transition-colors" />
            </div>
            <div className="flex-1 min-w-0">
              <div className="flex items-center gap-2">
                <p className="font-semibold text-foreground text-sm">{label}</p>
                <span className="text-xs text-muted-foreground font-mono">{path}</span>
              </div>
              <p className="text-xs text-muted-foreground mt-0.5">{description}</p>
            </div>
            <ArrowRight className="h-4 w-4 text-muted-foreground/30 group-hover:text-accent group-hover:translate-x-0.5 transition-all shrink-0 mt-0.5" />
          </Link>
        ))}
      </div>
    </div>
  );
}
