import React from "react"; import useGet from "../Hooks/useGet"; import {Col, Container, Row, Table} from "react-bootstrap"; import AddRoomForm from "./AddRoomForm"; const EditRoomForm = (props) => { console.log(props.room) const dateFormatter = (str) => { const inputDate = new Date(str); const options = { year: '2-digit', month: '2-digit', day: '2-digit' }; return inputDate.toLocaleString('en-GB', options); } const { data, isLoading, setData, getData } = useGet(`/hotel/rooms/${props.room.hotelRoomId}/available`) console.log(`/hotel/rooms/${props.room.hotelRoomId}/available`) !isLoading && console.log(data) return ( <> {!isLoading && data != null && data.map((avail, i) => { return () })}
# До Цена
{i + 1} {dateFormatter(avail.dateFrom)} {dateFormatter(avail.dateTo)} {avail.numberOfBeds}
) } export default EditRoomForm