import { getLeadsWithTags, getLeadFieldOptions } from "@/lib/admin-queries";
import { LeadsViewToggle } from "@/components/admin/leads/LeadsViewToggle";
import { CreateLeadModal } from "@/components/admin/leads/LeadForm";
import { PageHeader } from "@/components/admin/PageHeader";

export const revalidate = 0;

export default async function LeadsPage() {
  const [leads, options] = await Promise.all([
    getLeadsWithTags(),
    getLeadFieldOptions(),
  ]);

  return (
    <div className="space-y-6">
      <PageHeader
        title="Lead Pipeline"
        subtitle="Gestisci e monitora i tuoi contatti commerciali"
        action={<CreateLeadModal />}
      />
      <LeadsViewToggle leads={leads} options={options} />
    </div>
  );
}
