import { useTranslation } from "react-i18next"; import { RowWithCreatedBy } from "~/utils/db/entities/rows.db.server"; interface Props { row: RowWithCreatedBy; withEmail?: boolean; } export default function RowCreatedByBadge({ row, withEmail = true }: Props) { const { t } = useTranslation(); return (
{row.createdByUser && (
{t("shared.by")} {row.createdByUser.firstName} {row.createdByUser.lastName}
{" "} {withEmail && ({row.createdByUser.email})}
)}{" "} {row.createdByApiKey && (
{t("shared.by")} {t("models.apiKey.object")}
{" "} ({row.createdByApiKey.alias})
)}
); }