"use client"; import { Badge } from "@app/components/ui/badge"; import Image from "next/image"; type IdpTypeBadgeProps = { type: string; variant?: string; name?: string; }; export default function IdpTypeBadge({ type, variant, name }: IdpTypeBadgeProps) { const effectiveType = variant || type; const effectiveName = name || formatType(effectiveType); function formatType(type: string) { if (type === "google") return "Google"; if (type === "azure") return "Azure"; if (type === "oidc") return "OAuth2/OIDC"; return type.charAt(0).toUpperCase() + type.slice(1); } return ( {effectiveType === "google" && ( <> Google {effectiveName} )} {effectiveType === "azure" && ( <> Azure {effectiveName} )} {effectiveType === "oidc" && {effectiveName}} {!["google", "azure", "oidc"].includes(effectiveType) && ( {effectiveName} )} ); }