"use client"; import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert"; import { InfoSection, InfoSectionContent, InfoSections, InfoSectionTitle } from "@app/components/InfoSection"; import { useTranslations } from "next-intl"; import { Badge } from "./ui/badge"; import { useEnvContext } from "@app/hooks/useEnvContext"; type DomainInfoCardProps = { failed: boolean; verified: boolean; type: string | null; }; export default function DomainInfoCard({ failed, verified, type }: DomainInfoCardProps) { const t = useTranslations(); const env = useEnvContext(); const getTypeDisplay = (type: string) => { switch (type) { case "ns": return t("selectDomainTypeNsName"); case "cname": return t("selectDomainTypeCnameName"); case "wildcard": return t("selectDomainTypeWildcardName"); default: return type; } }; return ( {t("type")} {getTypeDisplay(type ? type : "")} {env.env.flags.usePangolinDns && ( {t("status")} {failed ? ( {t("failed", { fallback: "Failed" })} ) : verified ? ( type === "wildcard" ? ( {t("manual", { fallback: "Manual" })} ) : ( {t("verified")} ) ) : ( {t("pending", { fallback: "Pending" })} )} )} ); }