import React, { useMemo } from "react"; import { Button, Container, Hr, Text } from "@react-email/components"; import dayjs from "dayjs"; type MetaListProps = { tableName?: string; streamsFailed?: string; incidentStartedAt?: string; incidentStatus?: string; recoveredFrom?: string; queueSize?: number; entityType?: string; }; export const MetaList: React.FC = ({ tableName, incidentStartedAt, incidentStatus, recoveredFrom, streamsFailed, queueSize, entityType, }) => { const date = useMemo(() => new Date(), []); return ( {tableName ? ( Table Name: {tableName}
) : ( <> )} {recoveredFrom ? ( Recovered From: {recoveredFrom.toLowerCase()}
) : ( <> )} {incidentStatus ? ( Last Status: {incidentStatus}
) : ( <> )} {streamsFailed ? ( {entityType === "batch" ? "Tables" : "Streams"} Failed: {streamsFailed}
) : ( <> )} {incidentStartedAt && (date.getTime() - new Date(incidentStartedAt).getTime() > 5 * 60 * 1000 || recoveredFrom) ? ( Incident Started At: {dayjs(incidentStartedAt).toLocaleString()}
) : ( <> )} {queueSize ? ( Events Queue Size: {queueSize.toLocaleString()}
) : ( <> )}
); }; export const CheckJobStatusButton: React.FC<{ url?: string; label?: string; color?: string }> = ({ url, label = "Check Job Status", color = "#a21caf", }) => { if (!url) { return <>; } return ( ); }; export const Details: React.FC<{ details?: string }> = ({ details }) => { if (!details) { return <>; } return ( Details: {details.split("\n").map((line, index) => ( {line}
))}
); }; export const Footer: React.FC<{ unsubscribeLink?: string }> = ({ unsubscribeLink }) => { return ( <> Best Regards,
Jitsu Team
jitsu.com

{unsubscribeLink ? ( Manage your email notification preferences ) : ( <> )} Jitsu Labs Inc. 2261 Market Street #4109, San Francisco, CA 94114 ); };