import Link from "next/link"; import { ExternalLink } from "lucide-react"; import { ReactNode } from "react"; import { RemoteActor } from "@/lib/api"; import { UserAvatar } from "@/components/user-avatar"; import { Button } from "@/components/ui/button"; interface ProfileCardProps { actor: RemoteActor; /** Slot rendered next to the avatar (e.g. follow/unfollow button). */ action?: ReactNode; } export function ProfileCard({ actor, action }: ProfileCardProps) { let hostname: string | null = null; try { if (actor.url) hostname = new URL(actor.url).hostname; } catch { hostname = actor.url; } return ( <>
{actor.handle}
Also known as:{" "} {actor.alsoKnownAs}
)} {actor.attachment.length > 0 && (