<commit_before>import { Message } from 'proton-shared/lib/interfaces/mail/Message';
import React from 'react';
import { FormModal } from 'react-components';
import { c } from 'ttag';
import downloadFile from 'proton-shared/lib/helpers/downloadFile';

interface Props {
    message?: Message;
    onClose?: () => void;
}

const MessageHeadersModal = ({ message, onClose, ...rest }: Props) => {
    const content = `${message?.Header}\n\r${message?.Body}`;

    const handleDownload = () => {
        const blob = new Blob([content], { type: 'data:text/plain;charset=utf-8;' });
        downloadFile(blob, 'pgp.txt');
    };

    return (
        <FormModal
            title={c('Info').t`Message headers`}
            submit={c('Action').t`Download`}
            onSubmit={handleDownload}
            onClose={onClose}
            {...rest}
        >
            <pre className="p1 break">{content}</pre>
        </FormModal>
    );
};

export default MessageHeadersModal;<commit_msg>Hotfix - remove padding for better display of headers<commit_after>import { Message } from 'proton-shared/lib/interfaces/mail/Message';
import React from 'react';
import { FormModal } from 'react-components';
import { c } from 'ttag';
import downloadFile from 'proton-shared/lib/helpers/downloadFile';

interface Props {
    message?: Message;
    onClose?: () => void;
}

const MessageHeadersModal = ({ message, onClose, ...rest }: Props) => {
    const content = `${message?.Header}\n\r${message?.Body}`;

    const handleDownload = () => {
        const blob = new Blob([content], { type: 'data:text/plain;charset=utf-8;' });
        downloadFile(blob, 'pgp.txt');
    };

    return (
        <FormModal
            title={c('Info').t`Message headers`}
            submit={c('Action').t`Download`}
            onSubmit={handleDownload}
            onClose={onClose}
            {...rest}
        >
            <pre className="break">{content}</pre>
        </FormModal>
    );
};

export default MessageHeadersModal;
{'fraction_non_alphanumeric': 0.16125811283075386, 'fraction_numerical': 0.0014977533699450823, 'mean_word_length': 2.8026565464895636, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6745984', 'n_tokens_mistral': 590, 'n_tokens_neox': 588, 'n_words': 125}