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