import React, { JSX } from 'react'; import { BffCatalogEntity } from '@redocly/theme/core/types'; import { EmailIcon } from '@redocly/theme/icons/EmailIcon/EmailIcon'; import { CatalogEntityPropertyCard } from '@redocly/theme/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard'; import { Email } from '@redocly/theme/components/Catalog/CatalogTableView/CatalogUserEntityCell'; import { useThemeHooks } from '@redocly/theme/core/hooks'; export type UserEmailPropertyProps = { entity: BffCatalogEntity; }; export function UserEmailProperty({ entity }: UserEmailPropertyProps): JSX.Element { const { useTranslate } = useThemeHooks(); const { translate } = useTranslate(); const email = entity.metadata?.email; return (
{translate('catalog.email.label', 'Email')} } content={{email}} onClick={() => { window.open(`mailto:${email}`, '_blank'); }} />
); }