dev
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { prisma } from "@repo/db";
|
||||
import { getPublicUser, prisma } from "@repo/db";
|
||||
import { TriangleAlert } from "lucide-react";
|
||||
import { getServerSession } from "next-auth";
|
||||
import { PenaltyCountdown } from "./PenaltyCountdown";
|
||||
@@ -11,8 +11,13 @@ export const Penalty = async () => {
|
||||
until: {
|
||||
gte: new Date(),
|
||||
},
|
||||
suspended: false,
|
||||
|
||||
type: { in: ["TIME_BAN", "BAN"] },
|
||||
},
|
||||
include: {
|
||||
CreatedUser: true,
|
||||
},
|
||||
});
|
||||
if (!openPenaltys[0]) {
|
||||
return null;
|
||||
@@ -30,10 +35,16 @@ export const Penalty = async () => {
|
||||
<p className="text-left font-bold">
|
||||
Du hast eine aktive Strafe und kannst dich deshalb nicht mit dem Netzwerk verbinden.
|
||||
</p>
|
||||
<p className="text-left font-bold">Grund: {openPenaltys[0].reason}</p>
|
||||
<p className="text-left">
|
||||
<span className="font-bold">Grund:</span> {openPenaltys[0].reason}
|
||||
</p>
|
||||
<p className="text-left">
|
||||
<span className="font-bold">Admin:</span>{" "}
|
||||
{getPublicUser(openPenaltys[0].CreatedUser).fullName}
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
{openPenaltys[0].type === "BAN" && (
|
||||
{session?.user.isBanned && (
|
||||
<div className="card-body text-base-300">
|
||||
<h2 className="card-title text-3xl">
|
||||
<TriangleAlert />
|
||||
@@ -44,6 +55,10 @@ export const Penalty = async () => {
|
||||
ausgeschlossen wurdest. Du kannst dich nicht mehr mit dem Netzwerk verbinden.
|
||||
</p>
|
||||
<p className="text-left font-bold">Grund: {openPenaltys[0].reason}</p>
|
||||
<p className="text-left">
|
||||
<span className="font-bold">Admin:</span>{" "}
|
||||
{getPublicUser(openPenaltys[0].CreatedUser).fullName}
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user