Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

Delete generate-button.tsx

Steven Tey880905ceb97a
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/referrals/generate-button.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/referrals/generate-button.tsx
deleted file mode 100644
index 49faa9ecb4..0000000000
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/referrals/generate-button.tsx
+++ /dev/null
@@ -1,35 +0,0 @@
-"use client";
-
-import { generateReferralLink } from "@/lib/actions/generate-referral-link";
-import useWorkspace from "@/lib/swr/use-workspace";
-import { Button } from "@dub/ui";
-import { useAction } from "next-safe-action/hooks";
-import { useRouter } from "next/navigation";
-import { toast } from "sonner";
-
-export function GenerateButton() {
- const router = useRouter();
- const { id: workspaceId } = useWorkspace();
-
- const { executeAsync, isExecuting, hasSucceeded } = useAction(
- generateReferralLink,
- {
- onSuccess: () => {
- router.refresh();
- toast.success("Referral link generated.");
- },
- onError: ({ error }) => {
- toast.error(error.serverError);
- },
- },
- );
-
- return (
- <Button
- text="Activate Referral Link"
- className="h-9 w-auto rounded-lg"
- onClick={() => executeAsync({ workspaceId: workspaceId! })}
- loading={isExecuting || hasSucceeded}
- />
- );
-}