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

@ -13,6 +13,7 @@ import { useState } from "react";
export default function () {
const [showCookieBox, setShowCookieBox] = useState(false);
const [loading, setLoading] = useState(false)
return (
<Container maxW="container.md">
<Heading pt="36px">Let's get started</Heading>
@ -31,6 +32,7 @@ export default function () {
/>
<Button
onClick={async () => {
setLoading(true)
const createTransferReq = await fetch("/api/data-transfers/create", {
body: JSON.stringify({
can_access: !showCookieBox,
@ -45,6 +47,7 @@ export default function () {
});
if (!createTransferReq.ok) {
setLoading(false)
useToast()({
description: (
(await createTransferReq.json()) as { error: string }
@ -62,6 +65,8 @@ export default function () {
);
}}
pt="32px"
isLoading={loading}
loadingText='Processing...'
>
Continue
</Button>