Oh yeah I forgot the other half

This commit is contained in:
2023-10-19 16:50:58 -04:00
parent 387cf6a6b2
commit 0a4ad7792d
11 changed files with 96 additions and 13 deletions

View File

@ -18,9 +18,12 @@ import {
useDisclosure,
useToast,
} from "@chakra-ui/react";
import { useState } from "react";
export default function (props: GameAppealProps) {
const [loading, setLoading] = useState(false)
async function performAction(action: "accept" | "deny"): Promise<void> {
setLoading(true)
const statsReduction = parseInt(
(document.getElementById("reductPercentage") as HTMLInputElement).value,
);
@ -51,6 +54,8 @@ export default function (props: GameAppealProps) {
title: "An error occurred...",
},
);
setLoading(false)
}
const { isOpen, onClose, onOpen } = useDisclosure();
@ -108,6 +113,8 @@ export default function (props: GameAppealProps) {
colorScheme="blue"
ml="8px"
onClick={async () => await performAction("accept")}
isLoading={loading}
loadingText='Submitting...'
>
Submit
</Button>