diff --git a/src/app/(app)/problemset/page.tsx b/src/app/(app)/problemset/page.tsx index 43fb337..fd37b1a 100644 --- a/src/app/(app)/problemset/page.tsx +++ b/src/app/(app)/problemset/page.tsx @@ -8,20 +8,7 @@ import { 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"; - } -}; +import { getDifficultyColorClass } from "@/lib/utils"; export default async function ProblemsetPage() { const problems = await prisma.problem.findMany({ @@ -68,7 +55,7 @@ export default async function ProblemsetPage() { {problem.title} - + {problem.difficulty}