@@ -10,8 +10,55 @@ import useNotificationForm from '../../../hooks/useNotificationForm';
1010import NotificationsTemplates from '../../../../shared/notifications' ;
1111import NotificationModalPayload from '../../modal/notification/payload' ;
1212import NotificationModalType from '../../modal/notification/dropdown/type' ;
13- import * as NotificationPlatformContent from '../../../constant/notificatons /layout' ;
13+ import * as NotificationPlatformContent from '../../../constant/notifications /layout' ;
1414import NotificationRenderer from './renderer' ;
15+ import {
16+ NotificationBasicEmailTemplate ,
17+ NotificationNerdyEmailTemplate ,
18+ NotificationPrettyEmailTemplate ,
19+ } from '../emails' ;
20+
21+ export const EmailComponent = ( { type } : { type : string } ) => {
22+ if ( type === 'basic' ) {
23+ return (
24+ < NotificationBasicEmailTemplate
25+ serviceName = "Lunalytics"
26+ dashboardUrl = "https://lunalytics.xyz"
27+ timestamp = { new Date ( ) . toUTCString ( ) }
28+ />
29+ ) ;
30+ }
31+
32+ if ( type === 'pretty' ) {
33+ return (
34+ < NotificationPrettyEmailTemplate
35+ serviceName = "Lunalytics"
36+ dashboardUrl = "https://lunalytics.xyz"
37+ timestamp = { new Date ( ) . toUTCString ( ) }
38+ latency = { 54 }
39+ status = "504 Gateway Timeout"
40+ message = "The service is currently unreachable."
41+ />
42+ ) ;
43+ }
44+ if ( type === 'nerdy' ) {
45+ return (
46+ < NotificationNerdyEmailTemplate
47+ id = "23c91eb7-e56d-4b6d-a7b8-51bf99f04b76"
48+ serviceName = "Lunalytics"
49+ timestamp = { new Date ( ) . toUTCString ( ) }
50+ address = "example.com"
51+ type = "HTTP"
52+ statusCode = { 504 }
53+ latency = { 1832 }
54+ statusMessage = "Gateway Timeout"
55+ dashboardUrl = "https://lunalytics.xyz"
56+ />
57+ ) ;
58+ }
59+
60+ return null ;
61+ } ;
1562
1663const NotificationRender = ( { isEdit = false } : { isEdit : boolean } ) => {
1764 const {
@@ -67,7 +114,13 @@ const NotificationRender = ({ isEdit = false }: { isEdit: boolean }) => {
67114 />
68115
69116 < label className = "input-label" > { t ( 'notification.input.payload' ) } </ label >
70- < NotificationModalPayload message = { message } />
117+ { notification . platform !== 'Email' && (
118+ < NotificationModalPayload message = { message } />
119+ ) }
120+
121+ { notification . platform === 'Email' && (
122+ < EmailComponent type = { inputs . messageType } />
123+ ) }
71124
72125 < ActionBar position = "bottom" variant = "floating" show = { showSaveActionBar } >
73126 < div className = "status-action-bar-container" >
0 commit comments