"use client"; import React, { FC, Fragment, useState } from "react"; import { Dialog, Transition } from "@headlessui/react"; import { XMarkIcon } from "@heroicons/react/24/solid"; import ButtonPrimary from "@/shared/ButtonPrimary"; import GuestsInput from "@/app/(client-components)/(HeroSearchForm2Mobile)/GuestsInput"; interface ModalSelectGuestsProps { renderChildren?: (p: { openModal: () => void }) => React.ReactNode; } const ModalSelectGuests: FC = ({ renderChildren }) => { const [showModal, setShowModal] = useState(false); // FOR RESET ALL DATA WHEN CLICK CLEAR BUTTON // function closeModal() { setShowModal(false); } function openModal() { setShowModal(true); } const renderButtonOpenModal = () => { return renderChildren ? ( renderChildren({ openModal }) ) : ( ); }; return ( <> {renderButtonOpenModal()}
<>
{ closeModal(); }} > Save
); }; export default ModalSelectGuests;