RippleWorkers / src /components /dashboard /ConnectButton.tsx
damndeepesh
Initialize project with LavinMQ integration and Docker support
c7fbc2e
Raw History Blame Contribute Delete
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>
);
}