Discord Permissions will be revoked, when under a penalty

This commit is contained in:
PxlLoewe
2026-01-31 22:48:26 +01:00
parent d1c49a3208
commit ac441e908d
7 changed files with 94 additions and 40 deletions

View File

@@ -1,6 +1,7 @@
"use client";
import { ReactNode, useState } from "react";
import { cn } from "../helper/cn";
import { Button } from "./Button";
export const PenaltyDropdown = ({
onClick,
@@ -79,10 +80,10 @@ export const PenaltyDropdown = ({
<option value="1y">1 Jahr</option>
</select>
)}
<button
<Button
className={cn("btn btn-square btn-soft tooltip tooltip-bottom w-full", btnClassName)}
data-tip={btnTip}
onClick={() => {
onClick={async () => {
let untilDate: Date | null = null;
if (until !== "default") {
const now = new Date();
@@ -124,11 +125,11 @@ export const PenaltyDropdown = ({
untilDate = null;
}
}
onClick({ reason, until: untilDate });
await onClick({ reason, until: untilDate });
}}
>
{Icon} {btnName}
</button>
</Button>
</div>
)}
</div>