MIF_E31221222/sigap-website/components/email-templates/admin-notification.tsx

138 lines
2.7 KiB
TypeScript

import {
Body,
Container,
Head,
Heading,
Hr,
Html,
Preview,
Section,
Text,
} from "@react-email/components";
import * as React from "react";
interface AdminNotificationProps {
name: string;
email: string;
phone: string;
messageType: string;
message: string;
}
export const AdminNotification = ({
name,
email,
phone,
messageType,
message,
}: AdminNotificationProps) => {
return (
<Html>
<Head />
<Preview>New Contact Form Submission: {messageType}</Preview>
<Body style={main}>
<Container style={container}>
<Heading style={h1}>New Contact Form Submission</Heading>
<Section style={section}>
<Text style={detailLabel}>Name:</Text>
<Text style={detailValue}>{name}</Text>
<Text style={detailLabel}>Email:</Text>
<Text style={detailValue}>{email}</Text>
<Text style={detailLabel}>Phone:</Text>
<Text style={detailValue}>{phone}</Text>
<Text style={detailLabel}>Type:</Text>
<Text style={detailValue}>{messageType}</Text>
</Section>
<Section style={section}>
<Heading as="h2" style={h2}>
Message:
</Heading>
<Text style={messageBox}>{message}</Text>
</Section>
<Hr style={hr} />
<Text style={footer}>
This message was submitted through the contact form.
</Text>
</Container>
</Body>
</Html>
);
};
const main = {
backgroundColor: "#1C1C1C",
fontFamily:
'-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Ubuntu,sans-serif',
};
const container = {
backgroundColor: "#2E2E2E",
margin: "0 auto",
padding: "20px 0 48px",
marginBottom: "64px",
borderRadius: "8px",
};
const section = {
padding: "0 48px",
};
const h1 = {
color: "#10B981", // Emerald-500
fontSize: "24px",
fontWeight: "bold",
margin: "40px 0",
padding: "0",
textAlign: "center" as const,
};
const h2 = {
color: "#10B981", // Emerald-500
fontSize: "20px",
fontWeight: "bold",
margin: "24px 0",
padding: "0",
};
const detailLabel = {
color: "#A1A1AA", // Zinc-400
fontSize: "14px",
margin: "8px 0 4px",
};
const detailValue = {
color: "#FFFFFF",
fontSize: "14px",
margin: "0 0 16px",
};
const messageBox = {
backgroundColor: "#3F3F46", // Zinc-700
padding: "16px",
borderRadius: "4px",
color: "#FFFFFF",
fontSize: "14px",
lineHeight: "24px",
margin: "0",
};
const hr = {
borderColor: "#3F3F46", // Zinc-700
margin: "20px 0",
};
const footer = {
color: "#71717A", // Zinc-500
fontSize: "12px",
marginTop: "12px",
textAlign: "center" as const,
};
export default AdminNotification;