"use client"

import { useIntl } from "react-intl"

import { useEnterDetailsStore } from "@/stores/enter-details"

import Contact from "@/components/HotelReservation/Contact"
import Divider from "@/components/TempDesignSystem/Divider"
import SidePeek from "@/components/TempDesignSystem/SidePeek"
import Body from "@/components/TempDesignSystem/Text/Body"

import styles from "./enterDetailsSidePeek.module.css"

import {
  SidePeekEnum,
  SidePeekProps,
} from "@/types/components/enterDetails/sidePeek"

export default function EnterDetailsSidePeek({ hotel }: SidePeekProps) {
  const activeSidePeek = useEnterDetailsStore((state) => state.activeSidePeek)
  const close = useEnterDetailsStore((state) => state.closeSidePeek)

  const intl = useIntl()
  return (
    <SidePeek
      contentKey={SidePeekEnum.hotelDetails}
      title={intl.formatMessage({ id: "About the hotel" })}
      isOpen={activeSidePeek === SidePeekEnum.hotelDetails}
      handleClose={close}
    >
      <article className={styles.article}>
        <Contact hotel={hotel} />
        <Divider />
        <section className={styles.section}>
          <Body>{hotel.hotelContent.texts.descriptions.medium}</Body>

          <Body>{hotel.hotelContent.texts.facilityInformation}</Body>
        </section>
      </article>
    </SidePeek>
  )
}
