import React, { useMemo } from 'react';
import { makeStyles, Card } from '@material-ui/core';
import ReactHtmlParser from 'react-html-parser';
import { PrimaryActionHeader } from '../../utilityDisplay/utilityHeader/PrimaryActionHeader';
import { LayoutUnit } from '../../../layout/LayoutUnit';
import { useTranslation } from 'react-i18next';
import { CancelIcon } from '@fluentui/react-icons';
const useStyles = makeStyles((theme) => ({
    htmlContainer: { display: 'flex', justifyContent: 'center' }
}));
export const EmailDisplay = (props) => {
    const { html = '', to, from, title, handleClose } = props;
    const classes = useStyles();
    const { t } = useTranslation();
    const secondaryButtons = useMemo(() => {
        const buttons = [];
        if (handleClose) {
            buttons.push({
                label: t('Close'),
                component: CancelIcon,
                click: () => handleClose()
            });
        }
        return buttons;
    }, [t, handleClose]);
    return (React.createElement(React.Fragment, null, React.createElement(Card, { square: true }, React.createElement(PrimaryActionHeader
    //   key={`${selectedNode?.id}-${inSearch}`}
    //   title={headerTitle}
    //   buttonLabel={'Load'}
    //   secondaryButtons={secondaryButtons}
    //   handleClick={handlePrimaryAction}
    //   single
    , { 
        //   key={`${selectedNode?.id}-${inSearch}`}
        //   title={headerTitle}
        //   buttonLabel={'Load'}
        //   secondaryButtons={secondaryButtons}
        //   handleClick={handlePrimaryAction}
        //   single
        hidePAB: true, title: title, subheader: `To: ${to} . From: ${from}`, secondaryButtons: secondaryButtons })), React.createElement(LayoutUnit, { unit: "sm" }), React.createElement("div", { className: classes.htmlContainer }, ReactHtmlParser(html))));
};
//# sourceMappingURL=EmailDisplay.js.map