Penalty Nachricht im Admin form, abgelaufen für Timebans in tabelle werden Farblich dargestellt
This commit is contained in:
@@ -8,10 +8,10 @@ import {
|
||||
UserReports,
|
||||
} from "./_components/forms";
|
||||
import { Error } from "../../../../_components/Error";
|
||||
import { getUserPenaltys } from "@repo/shared-components";
|
||||
|
||||
export default async function Page({ params }: { params: Promise<{ id: string }> }) {
|
||||
const { id } = await params;
|
||||
|
||||
const user = await prisma.user.findUnique({
|
||||
where: {
|
||||
id: id,
|
||||
@@ -20,6 +20,7 @@ export default async function Page({ params }: { params: Promise<{ id: string }>
|
||||
discordAccounts: true,
|
||||
},
|
||||
});
|
||||
if (!user) return <Error statusCode={404} title="User not found" />;
|
||||
|
||||
const dispoSessions = await prisma.connectedDispatcher.findMany({
|
||||
where: {
|
||||
@@ -97,41 +98,43 @@ export default async function Page({ params }: { params: Promise<{ id: string }>
|
||||
open: totalReportsOpen,
|
||||
total60Days: totalReports60Days,
|
||||
};
|
||||
if (!user) return <Error statusCode={404} title="User not found" />;
|
||||
const { openBans, openTimeban } = await getUserPenaltys(user?.id);
|
||||
|
||||
return (
|
||||
<div className="grid grid-cols-6 gap-4">
|
||||
<div className="col-span-full flex justify-between items-center">
|
||||
<p className="text-2xl font-semibold text-left flex items-center gap-2">
|
||||
<PersonIcon className="w-5 h-5" />
|
||||
<div className="col-span-full flex items-center justify-between">
|
||||
<p className="flex items-center gap-2 text-left text-2xl font-semibold">
|
||||
<PersonIcon className="h-5 w-5" />
|
||||
{user?.firstname} {user?.lastname} #{user?.publicId}
|
||||
</p>
|
||||
<p
|
||||
className="text-sm text-gray-400 font-thin tooltip tooltip-left"
|
||||
className="tooltip tooltip-left text-sm font-thin text-gray-400"
|
||||
data-tip="Account erstellt am"
|
||||
>
|
||||
{new Date(user.createdAt).toLocaleString("de-DE")}
|
||||
</p>
|
||||
</div>
|
||||
<div className="card bg-base-200 shadow-xl mb-4 col-span-6 xl:col-span-3">
|
||||
<div className="card bg-base-200 col-span-6 mb-4 shadow-xl xl:col-span-3">
|
||||
<ProfileForm user={user} />
|
||||
</div>
|
||||
<div className="card bg-base-200 shadow-xl mb-4 col-span-6 xl:col-span-3">
|
||||
<div className="card bg-base-200 col-span-6 mb-4 shadow-xl xl:col-span-3">
|
||||
<AdminForm
|
||||
user={user}
|
||||
dispoTime={dispoTime}
|
||||
pilotTime={pilotTime}
|
||||
reports={reports}
|
||||
discordAccount={user.discordAccounts[0]}
|
||||
openBans={openBans}
|
||||
openTimebans={openTimeban}
|
||||
/>
|
||||
</div>
|
||||
<div className="card bg-base-200 shadow-xl mb-4 col-span-6 xl:col-span-6">
|
||||
<div className="card bg-base-200 col-span-6 mb-4 shadow-xl xl:col-span-6">
|
||||
<UserReports user={user} />
|
||||
</div>
|
||||
<div className="card bg-base-200 shadow-xl mb-4 col-span-6 xl:col-span-6">
|
||||
<div className="card bg-base-200 col-span-6 mb-4 shadow-xl xl:col-span-6">
|
||||
<UserPenalties user={user} />
|
||||
</div>
|
||||
<div className="card bg-base-200 shadow-xl mb-4 col-span-6 xl:col-span-6">
|
||||
<div className="card bg-base-200 col-span-6 mb-4 shadow-xl xl:col-span-6">
|
||||
<ConnectionHistory user={user} />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user