import cn from "classnames";
import type { ReactNode } from "react";
import { formatDateTime, T } from "src/locale";
interface Props {
domains: string[];
createdOn?: string;
niceName?: string;
provider?: string;
color?: string;
}
const DomainLink = ({ domain, color }: { domain: string; color?: string }) => {
// when domain contains a wildcard, make the link go nowhere.
let onClick: ((e: React.MouseEvent) => void) | undefined;
if (domain.includes("*")) {
onClick = (e: React.MouseEvent) => e.preventDefault();
}
return (
{domain}
);
};
export function DomainsFormatter({ domains, createdOn, niceName, provider, color }: Props) {
const elms: ReactNode[] = [];
if (domains.length === 0 && !niceName) {
elms.push(
Unknown
,
);
}
if (niceName && provider !== "letsencrypt") {
elms.push(
{niceName}
,
);
}
domains.map((domain: string) => elms.push(