import React from "react"; import { useLocation, useNavigate } from 'react-router-dom' import axios from "../../custom-axios/axios"; import '../UtilComponents/App.css' const UnapprovedDrivers = (props) => { const location = useLocation(); const navigate = useNavigate(); const checkDriversCar = async (driverId) => { const carResponse = await axios.get(`/car/driver/${driverId}`).catch(function (error) { if (error.response) { alert("There is no car registered for that driver.") } }) navigate("/car", {state: {car: carResponse.data}}) } return(

Unapproved Drivers


{props.drivers.map((term) => { return( ) })}
Name Surname Price per kilometer Status Level Number of grades Grade
{term.name} {term.surname} {term.pricePerKm} {term.status} {term.level} {term.numGrades} {term.grade} props.onApproveDriver(term.id)}>Approve checkDriversCar(term.id)}>Check car props.onDenyDriver(term.id)}>Deny
) } export default UnapprovedDrivers;