import React from "react"; import useGet from "../Hooks/useGet"; import {Col, Container, Row, Table} from "react-bootstrap"; import AddRoomForm from "./AddRoomForm"; import AddTripForm from "./AddTripForm"; const EditMainRouteForm = (props) => { console.log(props.route) const dateFormatter = (str) => { const inputDate = new Date(str); const options = { year: '2-digit', month: '2-digit', day: '2-digit', hours: '2-digit', minutes: '2-digit' }; return inputDate.toLocaleString('en-GB', options); } const { data, isLoading, setData, getData } = useGet(`/transport/${props.route.id}/available`) !isLoading && console.log(data) return ( <> {!isLoading && data != null && data.map((avail) => { return ( avail.routes.map((route, i) => { return () }))})}
# Од - До Време тргање Време пристигање Број патници Цена
{i + 1} {route.from} - {route.to} {dateFormatter(route.departure)} {dateFormatter(route.arrival)} {route.freeSpace}
) } export default EditMainRouteForm