@tmlmobilidade/emails
Version:
39 lines (38 loc) • 2.65 kB
JavaScript
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
/* * */
import { EmailWrapper, styles, ValidationSummary } from '../components/index.js';
import { Button, Hr, Section, Text } from '@react-email/components';
import { getAppConfig } from '@tmlmobilidade/lib';
export function SucessfulGtfsValidationEmail({ first_name, validation }) {
const go_link = getAppConfig('plans', 'frontend_url') + '/validations/' + validation._id;
const totalWarnings = validation.summary?.total_warnings ?? 0;
const hasData = validation.summary !== null && validation.summary !== undefined;
return (_jsx(EmailWrapper, { preview: "Valida\u00E7\u00E3o GTFS realizada com sucesso", children: _jsxs(Section, { children: [_jsxs(Text, { style: styles.text, children: ["\uD83D\uDC4B Ol\u00E1", ' ', first_name, ","] }), _jsx(Text, { style: styles.text, children: "Excelentes not\u00EDcias! A valida\u00E7\u00E3o do GTFS foi conclu\u00EDda com sucesso." }), _jsx(Hr, { style: { margin: '24px 0' } }), _jsx(ValidationSummary, { hasData: hasData, isSuccessful: true, totalErrors: 0, totalWarnings: totalWarnings }), _jsx(Hr, { style: { margin: '24px 0' } }), _jsx(Text, { style: styles.text, children: _jsx("strong", { children: "O que isto significa:" }) }), _jsxs(Text, { style: styles.text, children: ["\u2022 O GTFS est\u00E1 estruturalmente correto.", _jsx("br", {}), "\u2022 A valida\u00E7\u00E3o est\u00E1 pronta para ser convertida para plano.", totalWarnings > 0 ? ' (considere resolver os avisos)' : ''] }), totalWarnings > 0 && (_jsx(Text, { style: styles.textStyles.warning, children: "\uD83D\uDCA1 Nota: Os avisos encontrados n\u00E3o impedem o funcionamento do sistema, mas a sua corre\u00E7\u00E3o pode melhorar a qualidade dos dados." })), _jsxs(Text, { style: styles.text, children: ["Para ver os detalhes completos da valida\u00E7\u00E3o", totalWarnings > 0 ? ' e verificar os avisos' : '', ", clique no bot\u00E3o abaixo:"] }), _jsx(Button, { href: go_link, style: styles.button, children: "Ver Relat\u00F3rio Completo" })] }) }));
}
;
const validation = {
_id: '123',
created_at: 1715328000,
feeder_status: 'success',
file_id: '123',
gtfs_agency: {
agency_id: '123',
agency_name: 'Test Agency',
agency_timezone: 'Europe/Lisbon',
},
gtfs_feed_info: {
feed_lang: 'en',
},
notification_sent: false,
summary: {
messages: [],
total_errors: 0,
total_warnings: 3,
},
updated_at: 1715328000,
};
SucessfulGtfsValidationEmail.PreviewProps = {
first_name: 'Josué',
validation,
};
export default SucessfulGtfsValidationEmail;