import { Card } from "@/components/ui/card";
import { QuoteBuilderForm } from "@/components/admin/quotes/QuoteBuilderForm";
import { getAllClientsWithPayments } from "@/lib/admin-queries";
import { getAllOfferMacrosWithMicros } from "@/lib/admin-queries";

export const revalidate = 0;

export default async function QuoteBuilderPage() {
  const [clientsData, offersData] = await Promise.all([
    getAllClientsWithPayments(),
    getAllOfferMacrosWithMicros(),
  ]);

  return (
    <div className="space-y-6">
      <div>
        <h1 className="text-3xl font-bold text-gray-900">Crea Preventivo</h1>
        <p className="text-gray-600 mt-1">
          Componi un preventivo per il cliente selezionando l'offerta e il prezzo
        </p>
      </div>

      <Card className="p-6">
        <QuoteBuilderForm clients={clientsData} offerMacros={offersData} />
      </Card>
    </div>
  );
}
