diff --git a/src/components/mii/delete-mii-button.tsx b/src/components/mii/delete-mii-button.tsx index e5c4a0c..84f622f 100644 --- a/src/components/mii/delete-mii-button.tsx +++ b/src/components/mii/delete-mii-button.tsx @@ -21,6 +21,7 @@ export default function DeleteMiiButton({ miiId, miiName, likes, inMiiPage }: Pr const [isVisible, setIsVisible] = useState(false); const [error, setError] = useState(undefined); + const [inputMiiName, setInputMiiName] = useState(""); const handleSubmit = async () => { const response = await fetch(`/api/mii/${miiId}/delete`, { method: "DELETE" }); @@ -85,7 +86,7 @@ export default function DeleteMiiButton({ miiId, miiName, likes, inMiiPage }: Pr

Are you sure? This will delete your Mii permanently. This action cannot be undone.

-
+
mii image

@@ -95,13 +96,21 @@ export default function DeleteMiiButton({ miiId, miiName, likes, inMiiPage }: Pr

+

Type the Mii's name below to delete:

+ setInputMiiName(e.target.value)} /> + {error && Error: {error}}
- +
, diff --git a/src/components/submit-button.tsx b/src/components/submit-button.tsx index 775e692..c5067a7 100644 --- a/src/components/submit-button.tsx +++ b/src/components/submit-button.tsx @@ -5,11 +5,12 @@ import { Icon } from "@iconify/react"; interface Props { onClick: () => void | Promise; + disabled?: boolean; text?: string; className?: string; } -export default function SubmitButton({ onClick, text = "Submit", className }: Props) { +export default function SubmitButton({ onClick, disabled = false, text = "Submit", className }: Props) { const [isLoading, setIsLoading] = useState(false); const handleClick = async (event: React.FormEvent) => { @@ -24,7 +25,7 @@ export default function SubmitButton({ onClick, text = "Submit", className }: Pr }; return ( -