import React from "react"; import axios from "../../custom-axios/axios"; import { useNavigate } from 'react-router-dom' import { MapContainer, TileLayer, Marker, Popup } from 'react-leaflet' import 'leaflet/dist/leaflet.css'; import markerIconPng from "leaflet/dist/images/marker-icon.png" import {Icon} from 'leaflet' import '../UtilComponents/App.css' const Requests = (props) => { const navigate = useNavigate(); const toConfirmedRequest = async (driverId, requestId) => { const response = await axios.post(`/request/confirm/${driverId}/${requestId}`) navigate('/confirmed-request', {state: {confirmedRequest: response.data}}) }; return(

Requests


{props.requests.map((term) => { return( ) })}
City Street Number Passenger
{term.cityAddress} {term.streetAddress} {term.numberAddress} {term.passenger.name} {term.passenger.surname} toConfirmedRequest(localStorage.getItem("driverId"), term.id)}>Confirm
{props.requests.map((term) => { return(

{term.passenger.name} {term.passenger.surname}

{term.cityAddress}, {term.streetAddress}, {term.numberAddress}

toConfirmedRequest(localStorage.getItem("driverId"), term.id)}>Confirm
) })}
) } export default Requests;