<commit_before>import React, { MutableRefObject } from 'react';
import { c } from 'ttag';
import { Button, useModals, ConfirmModal, Alert, classnames, Tooltip } from 'react-components';
import { noop } from 'proton-shared/lib/helpers/function';

import { formatSimpleDate } from '../../helpers/date';
import { MessageExtended } from '../../models/message';

import AttachmentsButton from './attachments/AttachmentsButton';
import { hasFlag, getAttachments, getRecipients } from '../../helpers/message/messages';
import { MESSAGE_FLAGS } from '../../constants';

interface Props {
    message: MessageExtended;
    date: Date;
    lock: boolean;
    sending: boolean;
    closing: boolean;
    syncInProgress: boolean;
    syncStatus: string;
    onAddAttachments: (files: File[]) => void;
    onPassword: () => void;
    onExpiration: () => void;
    onSave: () => Promise<void>;
    onSend: () => Promise<void>;
    onDelete: () => Promise<void>;
    addressesBlurRef: MutableRefObject<() => void>;
}

const ComposerActions = ({
    message,
    date,
    lock,
    sending,
    closing,
    syncInProgress,
    syncStatus,
    onAddAttachments,
    onPassword,
    onExpiration,
    onSave,
    onSend,
    onDelete,
    addressesBlurRef
}: Props) => {
    const { createModal } = useModals();

    const handleDelete = () => {
        return createModal(
            <ConfirmModal onConfirm={onDelete} onClose={noop} title={c('Title').t`Delete`}>
                <Alert type="warning">{c('Info').t`Permanently delete this draft?`}</Alert>
            </ConfirmModal>
        );<commit_msg>Review text<commit_after>import React, { MutableRefObject } from 'react';
import { c } from 'ttag';
import { Button, useModals, ConfirmModal, Alert, classnames, Tooltip } from 'react-components';
import { noop } from 'proton-shared/lib/helpers/function';

import { formatSimpleDate } from '../../helpers/date';
import { MessageExtended } from '../../models/message';

import AttachmentsButton from './attachments/AttachmentsButton';
import { hasFlag, getAttachments, getRecipients } from '../../helpers/message/messages';
import { MESSAGE_FLAGS } from '../../constants';

interface Props {
    message: MessageExtended;
    date: Date;
    lock: boolean;
    sending: boolean;
    closing: boolean;
    syncInProgress: boolean;
    syncStatus: string;
    onAddAttachments: (files: File[]) => void;
    onPassword: () => void;
    onExpiration: () => void;
    onSave: () => Promise<void>;
    onSend: () => Promise<void>;
    onDelete: () => Promise<void>;
    addressesBlurRef: MutableRefObject<() => void>;
}

const ComposerActions = ({
    message,
    date,
    lock,
    sending,
    closing,
    syncInProgress,
    syncStatus,
    onAddAttachments,
    onPassword,
    onExpiration,
    onSave,
    onSend,
    onDelete,
    addressesBlurRef
}: Props) => {
    const { createModal } = useModals();

    const handleDelete = () => {
        return createModal(
            <ConfirmModal onConfirm={onDelete} onClose={noop} title={c('Title').t`Delete`}>
                <Alert type="warning">{c('Info').t`Are you sure you want to permanently delete this draft?`}</Alert>
            </ConfirmModal>
        );
{'fraction_non_alphanumeric': 0.14655441222326163, 'fraction_numerical': 0.0, 'mean_word_length': 3.2433862433862433, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 37, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2404012', 'n_tokens_mistral': 958, 'n_tokens_neox': 967, 'n_words': 229}