import { prisma } from "@/lib/db"; export const dynamic = "force-dynamic"; export default async function ClientesPage() { const clientes = await prisma.cliente.findMany({ orderBy: { createdAt: "desc" }, include: { cotizaciones: { select: { id: true } } }, }); return (

Clientes

{clientes.length} clientes registrados

{clientes.length === 0 ? (

No hay clientes

Los clientes se crean automaticamente al generar cotizaciones

) : ( )}
); } import { ClientesList } from "./ClientesList"; function ClientesListWrapper({ clientes, }: { clientes: { id: string; nombre: string; empresa: string | null; email: string | null; telefono: string | null; cotizaciones: { id: string }[]; }[]; }) { return ; }