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