Oh yeah I forgot the other half
This commit is contained in:
@ -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>
|
||||
|
Reference in New Issue
Block a user