import React, { useState } from 'react';
import { useTranslation } from 'react-i18next';
import { Button, CircularProgress, MenuItem } from '@material-ui/core';
import DoneIcon from '@material-ui/icons/Done';
import Nui from '../../../../os/nui-events/utils/Nui';
import { TwitterEvents } from '../../../../../../typings/twitter';
const LOADING_TIME = 1250;
function ReportButton({ handleClose, tweetId, isReported }) {
const { t } = useTranslation();
const [loading, setLoading] = useState(false);
const handleClick = () => {
Nui.send(TwitterEvents.REPORT, tweetId);
setLoading(true);
window.setTimeout(() => {
setLoading(false);
handleClose();
}, LOADING_TIME);
};
if (isReported) {
return (
);
}
if (loading) {
return (
);
}
return ;
}
export default ReportButton;