diff --git a/components/NewGameBan.tsx b/components/NewGameBan.tsx
index 8ea12fc..8de4055 100644
--- a/components/NewGameBan.tsx
+++ b/components/NewGameBan.tsx
@@ -1,6 +1,8 @@
import {
Button,
+ HStack,
Input,
+ Link,
Modal,
ModalBody,
ModalCloseButton,
@@ -10,14 +12,72 @@ import {
ModalOverlay,
Radio,
RadioGroup,
+ Table,
+ TableContainer,
+ Tbody,
Text,
+ Td,
+ Th,
+ Thead,
+ Tr,
+ useToast,
} from "@chakra-ui/react";
+import { useState } from "react";
export default function (props: { isOpen: boolean; onClose: () => void }) {
+ const actionMap: { [k: string]: number } = {};
+ const [rows, setRows] = useState([] as JSX.Element[]);
+
+ function addUser(user: string) {
+ const newRows = [...rows];
+ newRows.push(
+
+ {user} |
+
+
+ Object.defineProperty(actionMap, user, {
+ value: parseInt(val),
+ })
+ }
+ >
+
+ Do Nothing
+ Hide from Leaderboards
+ Ban
+
+
+ |
+
+ removeUser(user)}>Remove
+ |
+
+ );
+ }
+
+ function removeUser(user: string) {
+ const newRows = [...rows];
+ const el = newRows.find((el) => el.key === user);
+
+ if (!el) return;
+
+ const elIdx = newRows.indexOf(el);
+
+ if (elIdx === -1) return;
+
+ newRows.splice(elIdx, 1);
+ setRows(newRows);
+
+ delete actionMap[user];
+ }
+
function reset() {
(document.getElementById("username") as HTMLInputElement).value = "";
(document.getElementById("evidence") as HTMLInputElement).value = "";
+ setRows([]);
+ Object.keys(actionMap).forEach((k) => delete actionMap[k]);
+
props.onClose();
}
@@ -29,9 +89,59 @@ export default function (props: { isOpen: boolean; onClose: () => void }) {
Username(s)
-
+
+
+
+
+
+
+ Username |
+ Punishment |
+ Remove |
+
+
+ {rows}
+
+
+
+
+ Evidence
+