import { CopyIcon } from "lucide-react"; import React from "react"; import { toast } from "sonner"; import { AppDetailConnectedApps } from "src/components/connections/AppDetailConnectedApps"; import { AppStoreDetailHeader } from "src/components/connections/AppStoreDetailHeader"; import { appStoreApps } from "src/components/connections/SuggestedAppData"; import ExternalLink from "src/components/ExternalLink"; import { Button } from "src/components/ui/button"; import { Card, CardContent, CardHeader, CardTitle, } from "src/components/ui/card"; import { LoadingButton } from "src/components/ui/custom/loading-button"; import { Input } from "src/components/ui/input"; import { Label } from "src/components/ui/label"; import { Textarea } from "src/components/ui/textarea"; import { copyToClipboard } from "src/lib/clipboard"; import { createApp } from "src/requests/createApp"; import { handleRequestError } from "src/utils/handleRequestError"; export function SimpleBoost() { const [name, setName] = React.useState(""); const [isLoading, setLoading] = React.useState(false); const [nwcUri, setNwcUri] = React.useState(""); const [scriptContent, setScriptContent] = React.useState(""); React.useEffect(() => { if (nwcUri) { setScriptContent(` Boost $1.00`); } }, [nwcUri]); const appStoreApp = appStoreApps.find((app) => app.id === "simpleboost"); if (!appStoreApp) { return null; } const handleSubmit = async (event: React.FormEvent) => { event.preventDefault(); setLoading(true); (async () => { try { const createAppResponse = await createApp({ name, scopes: ["lookup_invoice", "make_invoice"], isolated: true, metadata: { app_store_app_id: "simpleboost", }, }); setNwcUri(createAppResponse.pairingUri); toast("Simple Boost connection created"); } catch (error) { handleRequestError("Failed to create connection", error); } setLoading(false); })(); }; return (
{nwcUri && ( How to Add Widget

Paste the following code into an HTML block on your website.