"use server"; import { prisma } from "@/lib/prisma"; export type GalleryVariantStats = { total: number; withGallery: number; missing: number; }; export async function getGalleryVariantStats(): Promise { const [total, withGallery] = await Promise.all([ prisma.artwork.count(), prisma.artwork.count({ where: { variants: { some: { type: "gallery" } } }, }), ]); return { total, withGallery, missing: total - withGallery, }; }