Spaces:
Runtime error
Runtime error
Download src/components/dashboard/ConnectButton.tsx from damndeepesh-dev/RippleWorkers: direct link, hf CLI and curl.
- Browser
- Download file 879 Bytes
-
https://huggingface.co/spaces/damndeepesh-dev/RippleWorkers/resolve/main/src/components/dashboard/ConnectButton.tsx
- Command line
-
hf download hf://spaces/damndeepesh-dev/RippleWorkers/src/components/dashboard/ConnectButton.tsx
-
curl -L -o ConnectButton.tsx https://huggingface.co/spaces/damndeepesh-dev/RippleWorkers/resolve/main/src/components/dashboard/ConnectButton.tsx
879 Bytes
| "use client"; | |
| import { signIn } from "next-auth/react"; | |
| import { Instagram } from "lucide-react"; | |
| import { useState } from "react"; | |
| export default function ConnectButton() { | |
| const [isLoading, setIsLoading] = useState(false); | |
| const handleConnect = async () => { | |
| setIsLoading(true); | |
| // Redirect to our custom API route that initiates the Facebook OAuth flow for connecting connections | |
| window.location.href = "/api/connect/instagram"; | |
| }; | |
| return ( | |
| <button | |
| onClick={handleConnect} | |
| disabled={isLoading} | |
| className="flex items-center gap-2 px-3 py-1.5 bg-primary-green hover:bg-emerald-600 text-white text-sm font-medium rounded transition-colors disabled:opacity-50" | |
| > | |
| <Instagram size={16} /> | |
| {isLoading ? "Connecting..." : "Add Account"} | |
| </button> | |
| ); | |
| } | |