"use client" import { useCallback } from "react" import { useIntl } from "react-intl" import { useRateSelectionStore } from "@/stores/select-rate/rate-selection" import { EditIcon } from "@/components/Icons" import Image from "@/components/Image" import Button from "@/components/TempDesignSystem/Button" import Caption from "@/components/TempDesignSystem/Text/Caption" import Subtitle from "@/components/TempDesignSystem/Text/Subtitle" import styles from "./selectedRoomPanel.module.css" import type { Room as SelectedRateRoom } from "@/types/components/hotelReservation/selectRate/selectRate" import type { Room } from "@/types/hotel" interface SelectedRoomPanelProps { roomIndex: number room: SelectedRateRoom roomCategories: Room[] } export default function SelectedRoomPanel({ roomIndex, room, roomCategories, }: SelectedRoomPanelProps) { const intl = useIntl() const { rateSummary, modifyRate } = useRateSelectionStore() const selectedRate = rateSummary[roomIndex] const images = roomCategories.find((roomCategory) => roomCategory.roomTypes.some( (roomType) => roomType.code === selectedRate?.roomTypeCode ) )?.images const handleModify = useCallback(() => { modifyRate(roomIndex) }, [modifyRate, roomIndex]) return (