import { DateTimeFormat, intl } from "src/locale"; interface Props { domains: string[]; createdOn?: string; } const DomainLink = ({ domain }: { domain: 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 }: Props) { return (
{domains.map((domain: string) => ( ))}
{createdOn ? (
{intl.formatMessage({ id: "created-on" }, { date: DateTimeFormat(createdOn) })}
) : null}
); }