Last change
on this file since efaa053 was 07f4e8b, checked in by darsov2 <62809499+darsov2@…>, 8 months ago |
prefinal fixes
|
-
Property mode
set to
100644
|
File size:
1.4 KB
|
Rev | Line | |
---|
[e6c2521] | 1 | import React from "react";
|
---|
| 2 | import Form from "react-bootstrap/Form";
|
---|
| 3 | import FaHotel from "react-icons/fa";
|
---|
| 4 | import {Button} from "react-bootstrap";
|
---|
| 5 | import useCreate from "../Hooks/useCreate";
|
---|
| 6 | import RoomRow from "./RoomRow";
|
---|
| 7 |
|
---|
| 8 | const 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>
|
---|
[07f4e8b] | 22 | {Array.from(
|
---|
| 23 | new Set(props.data.map((x) => JSON.stringify(x.hotelRoom)))
|
---|
| 24 | ).map((roomString) => JSON.parse(roomString)).map((room) => {
|
---|
[e6c2521] | 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 |
|
---|
| 40 | export default RoomsTable;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.