import React from 'react'; import { useHistory } from 'react-router-dom'; import Input from '../components/Input'; import Button from '../components/Button'; import Paper from '../components/Paper'; import { patch } from '../requests'; import { PanelProps } from './Service/ServiceContext'; const WaybillPanel: React.FC = ({ item }) => { const history = useHistory(); const handleExecute = () => patch(`/waybills/${item._id}`, { status: 'executed' }) .then(() => history.push('/waybills')); const handleCancel = () => patch(`/waybills/${item._id}`, { status: 'cancelled' }) .then(() => history.push('/waybills')); const executed = item.status === 'executed'; return (

Итоговая сумма: ${item.total}

{ executed ? : }
); }; export default WaybillPanel;