"use client"; import { useState } from "react"; import { Linkedin, Loader2, ArrowRight } from "lucide-react"; import { useRouter } from "next/navigation"; export function OnboardingLinkedInStep() { const [loading, setLoading] = useState(false); const [error, setError] = useState(null); const router = useRouter(); const handleConnect = async () => { setLoading(true); setError(null); try { const res = await fetch("/api/linkedin/connect", { method: "POST" }); const data = await res.json(); if (!res.ok) { setError(data.error ?? "Something went wrong. You can connect later in Settings."); return; } window.location.href = data.url; } catch { setError("Could not connect to LinkedIn. You can try later from Settings."); } finally { setLoading(false); } }; const handleSkip = () => { router.push("/dashboard"); }; return (

Connect LinkedIn

Connect your LinkedIn account to start automated outreach campaigns. You can also do this later from your Settings.

{error && (

{error}

)}
); }