1 | import React, {useState} from "react";
|
---|
2 | import {Container, Row, Col, Image} from "react-bootstrap";
|
---|
3 | import {LuFan} from "react-icons/lu";
|
---|
4 | import {TbToolsKitchen2} from "react-icons/tb"
|
---|
5 | import {MdBalcony} from "react-icons/md"
|
---|
6 | import Carousel from "react-bootstrap/Carousel";
|
---|
7 |
|
---|
8 | const Room = (props) => {
|
---|
9 | console.log("OD SOBATA")
|
---|
10 | const [index, setIndex] = useState(0);
|
---|
11 | const handleSelect = (selectedIndex) => {
|
---|
12 | setIndex(selectedIndex);
|
---|
13 | };
|
---|
14 | console.log(props)
|
---|
15 | return (
|
---|
16 | <>
|
---|
17 | <Container style={{width: "100%"}}>
|
---|
18 | <Row className="g-0">
|
---|
19 | <Col
|
---|
20 | className="d-flex justify-content-center"
|
---|
21 | style={{maxWidth: "40%"}}
|
---|
22 | >
|
---|
23 | <Carousel activeIndex={index} onSelect={handleSelect}>
|
---|
24 | {props.data.images.map(img => {
|
---|
25 | let link = img.url;
|
---|
26 | if (img.url.includes('Desktop')) {
|
---|
27 | link = 'http://localhost:8080/download?fileName=' + encodeURIComponent(img.url);
|
---|
28 | }
|
---|
29 | return (<Carousel.Item>
|
---|
30 | <Image src={link}/>
|
---|
31 | </Carousel.Item>)
|
---|
32 | })}
|
---|
33 | {props.data.images.length === 0 && <h4>
|
---|
34 | Не се достапни слики!
|
---|
35 | </h4>}
|
---|
36 | </Carousel>
|
---|
37 | </Col>
|
---|
38 | <Col>
|
---|
39 | <Container className="m-auto">
|
---|
40 | <Row>
|
---|
41 | <h5 style={{textAlign: "left"}}>
|
---|
42 | {props.data.hotelRoomName}
|
---|
43 | </h5>
|
---|
44 | </Row>
|
---|
45 | <Row>
|
---|
46 | {props.data.airCondition && <Col className="col-auto">
|
---|
47 | <Container className="py-1 px-1">
|
---|
48 | <Row className="d-flex flex-row">
|
---|
49 | <Col className="m-0 w-25 py-1">
|
---|
50 | <LuFan
|
---|
51 | className="my-0 "
|
---|
52 | color="#159895"
|
---|
53 | size={25}
|
---|
54 | ></LuFan>
|
---|
55 | </Col>
|
---|
56 | <Col className="w-75 d-flex p-0">
|
---|
57 | <h6 style={{fontSize: "10px"}} className="m-auto">
|
---|
58 | Климатизирано
|
---|
59 | </h6>
|
---|
60 | </Col>
|
---|
61 | </Row>
|
---|
62 | </Container>
|
---|
63 | </Col>}
|
---|
64 | {props.data.kitchenAvailable && <Col className="col-auto">
|
---|
65 | <Container
|
---|
66 | className="py-1 px-1">
|
---|
67 | <Row className="d-flex flex-row">
|
---|
68 | <Col className="m-0 w-25 py-1">
|
---|
69 | <TbToolsKitchen2 className="my-0 " color="#159895"
|
---|
70 | size={25}></TbToolsKitchen2>
|
---|
71 | </Col>
|
---|
72 | <Col className="w-75 d-flex p-0">
|
---|
73 | <h6 style={{fontSize: "10px"}} className="m-auto">Кујна</h6>
|
---|
74 | </Col>
|
---|
75 | </Row>
|
---|
76 | </Container>
|
---|
77 | </Col>}
|
---|
78 | {props.data.balcony && <Col className="col-auto">
|
---|
79 | <Container
|
---|
80 | className="py-1 px-1">
|
---|
81 | <Row className="d-flex flex-row">
|
---|
82 | <Col className="m-0 w-25 py-1">
|
---|
83 | <MdBalcony className="my-0 " color="#159895" size={25}></MdBalcony>
|
---|
84 | </Col>
|
---|
85 | <Col className="w-75 d-flex p-0">
|
---|
86 | <h6 style={{fontSize: "10px"}} className="m-auto">Тераса</h6>
|
---|
87 | </Col>
|
---|
88 | </Row>
|
---|
89 | </Container>
|
---|
90 | </Col>}
|
---|
91 | </Row>
|
---|
92 | <Row>
|
---|
93 | <p style={{textAlign: "left", textDecoration: "none"}}>
|
---|
94 | {props.data.hotelRoomDescription}
|
---|
95 | </p>
|
---|
96 | </Row>
|
---|
97 | </Container>
|
---|
98 | </Col>
|
---|
99 | </Row>
|
---|
100 | </Container>
|
---|
101 | </>
|
---|
102 | );
|
---|
103 | };
|
---|
104 |
|
---|
105 | export default Room;
|
---|