Back

Version 97

11/5/2024
/** @jsxImportSource https://esm.sh/react */
import React, { useEffect, useState } from "https://esm.sh/react";
import { createRoot } from "https://esm.sh/react-dom/client";

function ThankYouCard({ note, theme, font }) {
return (
<div className="card-container">
<div className="card-left">
<p>{note}</p>
</div>
<div className="card-right">
<div className="cake">
<div className="cake-top"></div>
<div className="cake-middle"></div>
<div className="cake-bottom"></div>
<div className="candles">
{[...Array(11)].map((_, i) => (
<div key={i} className="candle"></div>
))}
</div>
</div>
</div>
</div>
);
}

function App() {
const [note, setNote] = useState("You're the best");
const [isLoading, setIsLoading] = useState(false);
const [error, setError] = useState("");

const handleSubmit = async (e) => {
e.preventDefault();
setIsLoading(true);
setError("");
try {