import Link from "next/link"; import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow, } from "@/components/ui/table"; import prisma from "@/lib/prisma"; import { Difficulty } from "@prisma/client"; const getDifficultyColor = (difficulty: Difficulty) => { switch (difficulty) { case "EASY": return "text-green-500"; case "MEDIUM": return "text-yellow-500"; case "HARD": return "text-red-500"; default: return "text-gray-500"; } }; export default async function ProblemsetPage() { const problems = await prisma.problem.findMany({ where: { published: true }, }); return ( Id Title Difficulty {problems.map((problem) => ( {problem.id} {problem.title} {problem.difficulty} ))}
); }