import { FC } from 'react';

import { EmailPreview } from './email-preview';
import { OptOutMessageState } from '../opt-out-message';

interface OptOutMessagePreviewProps extends OptOutMessageState {
    open: boolean;
    onClose(): void;
}

export const OptOutEmailPreview: FC<OptOutMessagePreviewProps> = ({
    open,
    onClose,
    header,
    body,
    buttonText,
}) => {
    if (!open) {
        return null;
    }

    return (
        <EmailPreview
            title="Opt-Out Email Preview"
            onClose={onClose}
            header={header.value}
            body={body.value}
            buttonText={buttonText.value}
        />
    );
};
