import React, {Component} from 'react'; import {Link} from 'react-router-dom' class Orders extends Component { componentDidMount() { this.props.getUsers(); this.props.getOrders({doctors:this.props.doctors,services:this.props.services,users:this.props.users}); } changeInputFindOrder = (e) => { this.props.changeInputFindOrder(e.target.value) }; findOrders = () => { this.props.findOrdersArray() }; enterPressed = (e) => { if (e.key === 'Enter') { this.findOrders(); } }; render() { const{findOrderInput,ordersArray,searching,orders} = this.props; console.log(this.props); return (
{findOrderInput && } {searching && ordersArray.length === 0 &&

Order not found

} {ordersArray.map(el => (
{el.orderNumber}

{el.date.split('T')[0]}

{el.time}

{el.user.email} {el.doctor.name} {el.spec.name}
))}
{orders.map(el => (
{el.orderNumber}

{el.date.split('T')[0]}

{el.time}

{el.user.email} {el.doctor.name} {el.spec.name}
))}
); } } export default Orders;