"use client" import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card" import { Button } from "@/components/ui/button" import { CheckCircle2, FileUp, Settings, LayoutDashboard } from "lucide-react" import { useRouter } from "next/navigation" import { completeSetup } from "@/lib/api" import { docsUrl } from "@/lib/docs" import { useEffect, useState } from "react" interface SetupCompleteProps { identityMode: string | null } const MODE_LABELS: Record = { did_web: "Domain identity (did:web)", did_plc: "Network identity (did:plc)", attach_account: "Linked AT Protocol account", not_exposed: "Skipped — using built-in auth", } export function SetupComplete({ identityMode }: SetupCompleteProps) { const router = useRouter() const [error, setError] = useState(null) useEffect(() => { if (identityMode === "not_exposed") { completeSetup().catch((e) => { setError(e instanceof Error ? e.message : "Failed to finalize setup. You can retry from the dashboard settings.") }) } }, [identityMode]) const modeLabel = identityMode ? MODE_LABELS[identityMode] ?? identityMode : "Configured" return (
Your AppView is ready {identityMode === "not_exposed" ? "HappyView is running with built-in auth. You can configure a service identity anytime from settings." : "Your service identity is configured and your AppView is ready to accept requests from the AT Protocol network."}
Service identity
{modeLabel}
What does this mean?
{error &&

{error}

}

Next steps

) }