import { Box, Card, CardContent, CardHeader, Container } from '@material-ui/core';
import React from 'react';
import { useTranslation } from 'react-i18next';
import { useParams } from 'react-router';
import { useEmail } from '../hooks/useEmail';
export const EmailDetails = () => {
const { t } = useTranslation();
const { id } = useParams<{ id: string }>();
const { getEmailById } = useEmail();
const email = getEmailById(Number(id));
if (!email) {
return (
404
);
}
return (
{t('GENERIC_FROM')}: {email.sender}
{t('GENERIC_TO')}: {email.receivers.join(', ')}
{t('APPS_EMAIL_SUBJECT')}: {email.subject || '( - )'}
{email.body}
);
};