import { prisma } from '@/lib/db'; import { isAuthenticated, logoutAdmin, deleteButton } from '@/app/actions/admin'; import { redirect } from 'next/navigation'; import { ThemeToggle } from '@/components/ThemeToggle'; import { LogOut, ArrowLeft, Trash2 } from 'lucide-react'; import Link from 'next/link'; import { AddButtonForm } from '@/components/AddButtonForm'; import { ICON_MAP, parseIcon } from '@/lib/lucideIcons'; import { Globe } from 'lucide-react'; export const dynamic = 'force-dynamic'; export default async function AdminPage() { const auth = await isAuthenticated(); if (!auth) redirect('/admin/login'); const buttons = await prisma.button.findMany({ orderBy: { order: 'asc' }, }); return (
{buttons.length} application{buttons.length !== 1 ? 's' : ''} configurée{buttons.length !== 1 ? 's' : ''}