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 { post } from '../requests'; import { PanelProps } from './Service/ServiceContext'; const WaybillPanel: React.FC = ({ item }) => { const history = useHistory(); const handleExecute = () => post(`/waybills/${item._id}/execute`) .then(() => history.push('/waybills')); const handleCancel = () => post(`/waybills/${item._id}/cancel`) .then(() => history.push('/waybills')); const executed = item.status === 'executed'; const total = item.product.price * item.quantity; return (

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

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