import { ExclamationTriangleIcon } from "@radix-ui/react-icons";
import { prisma } from "@repo/db";
import { Error } from "_components/Error";

export default async function Page({ params }: { params: Promise<{ id: string }> }) {
	const { id } = await params;

	const penalty = await prisma.penalty.findUnique({
		where: {
			id: Number(id),
		},
		include: {
			User: true,
			CreatedUser: true,
		},
	});

	if (!penalty) return <Error statusCode={404} title="User not found" />;

	return (
		<div className="grid grid-cols-6 gap-4">
			<div className="col-span-full">
				<p className="text-2xl font-semibold text-left flex items-center gap-2">
					<ExclamationTriangleIcon className="w-5 h-5" />
					Strafe #{penalty.id}
				</p>
			</div>
		</div>
	);
}
