import { prisma } from '@/lib/db'; import { getSession } from '@/lib/auth'; import { redirect } from 'next/navigation'; import { Trash2, Plus, Image as ImageIcon } from 'lucide-react'; import { addGalleryItem, deleteGalleryItem } from '../actions'; import { revalidatePath } from 'next/cache'; import { uploadImage } from '@/lib/cloudinary'; export default async function GalleryAdminPage() { const session = await getSession(); if (!session) redirect('/admin/login'); const galleryItems = await prisma.gallery.findMany({ orderBy: { createdAt: 'desc' } }); return (
{item.category}