Le formatting

This commit is contained in:
regalijan 2023-10-19 16:51:01 -04:00
parent b5a92db954
commit 486762cc3d
Signed by: regalijan
GPG Key ID: 5D4196DA269EF520

View File

@ -10,11 +10,11 @@ import {
ModalOverlay, ModalOverlay,
Select, Select,
Text, Text,
useToast useToast,
} from "@chakra-ui/react"; } from "@chakra-ui/react";
import { useState } from "react"; import { useState } from "react";
export default function(props: { isOpen: boolean; onClose: () => void }) { export default function (props: { isOpen: boolean; onClose: () => void }) {
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
const [punishment, setPunishment] = useState(""); const [punishment, setPunishment] = useState("");
const [user, setUser] = useState(""); const [user, setUser] = useState("");
@ -24,7 +24,7 @@ export default function(props: { isOpen: boolean; onClose: () => void }) {
if (!props.isOpen) return; if (!props.isOpen) return;
const evidenceElement = document.getElementById( const evidenceElement = document.getElementById(
"evidence" "evidence",
) as HTMLInputElement; ) as HTMLInputElement;
if (!evidenceElement.files && e.clipboardData?.files) { if (!evidenceElement.files && e.clipboardData?.files) {
@ -74,7 +74,7 @@ export default function(props: { isOpen: boolean; onClose: () => void }) {
const postReq = await fetch("/api/infractions/new", { const postReq = await fetch("/api/infractions/new", {
body: form, body: form,
method: "POST" method: "POST",
}); });
if (postReq.ok) { if (postReq.ok) {
@ -84,7 +84,7 @@ export default function(props: { isOpen: boolean; onClose: () => void }) {
duration: 5000, duration: 5000,
isClosable: true, isClosable: true,
status: "success", status: "success",
title: "Success" title: "Success",
}); });
props.onClose(); props.onClose();
@ -100,7 +100,7 @@ export default function(props: { isOpen: boolean; onClose: () => void }) {
duration: 5000, duration: 5000,
isClosable: true, isClosable: true,
status: "error", status: "error",
title: "Error" title: "Error",
}); });
} }