source: frontend/src/Components/HotelDetails/RoomsTable.js@ 07f4e8b

Last change on this file since 07f4e8b was 07f4e8b, checked in by darsov2 <62809499+darsov2@…>, 5 months ago

prefinal fixes

  • Property mode set to 100644
File size: 1.4 KB
Line 
1import React from "react";
2import Form from "react-bootstrap/Form";
3import FaHotel from "react-icons/fa";
4import {Button} from "react-bootstrap";
5import useCreate from "../Hooks/useCreate";
6import RoomRow from "./RoomRow";
7
8const RoomsTable = (props) => {
9
10 return (
11 <>
12 <table className="m-auto table table-hover table-responsive">
13 <thead>
14 <tr>
15 <th scope="col">Тип на соба</th>
16 <th scope="col">Цена</th>
17 <th scope="col">Колку единици?</th>
18 <th scope="col"></th>
19 </tr>
20 </thead>
21 <tbody>
22 {Array.from(
23 new Set(props.data.map((x) => JSON.stringify(x.hotelRoom)))
24 ).map((roomString) => JSON.parse(roomString)).map((room) => {
25 return (
26 <>
27 <RoomRow
28 availableId={props.data.filter(x => x.hotelRoom.hotelRoomId === room.hotelRoomId).
29 map(x => x.hotelRoomAvailableId)[0]}
30 data={props.data} room={room} from={props.from} to={props.to}/>
31 </>
32 );
33 })}
34 </tbody>
35 </table>
36 </>
37 );
38};
39
40export default RoomsTable;
Note: See TracBrowser for help on using the repository browser.