import React, { useState } from "react"; import { Button } from "../Button"; import './style.css' export interface HotelCardIE{ address:string, can_buy:boolean, city:string, description:string, email:string, lat:number, lon:number, phones: { id:number, name:string, number: string }[], place?:any, polymorphic_ctype:number, priority: boolean, region: string, rooms:{ amenities:string[], description:string, images: { source:{ id:string } }[], integration_id:string, name:string, rate_plans:{ description:string, integration_id:string, name:string }[] }[], sort:number, source: any, stars:number, title: string } export const HotelCard:React.FC = (props) =>{ const [liked, setLiked] = useState(false) const [opened, setOpened] = useState(false) console.log(props) return(
{ opened?

{props.title}

{props.address}

{props.phones.map((phone)=>
{phone.name} {phone.number}
)}
{props.rooms != null? props.rooms.map((room)=>
{room.name}
{room.description}
) : null }
:null }
{props.stars}*
setLiked(!liked)} src={liked? 'icons/liked.svg':'icons/unliked.svg'}>

{props.title}

{props.address}
{ props.rooms == null? null:
{props.rooms.length} видов номеров
}
); }