"use client";

import { useState } from "react";
import WhatsAppPrompt from "@/components/WhatsAppPrompt";
import type { Lang } from "@/lib/config";

type ContactPageClientProps = {
  lang: Lang;
  children: (props: {
    isWhatsAppModalOpen: boolean;
    setIsWhatsAppModalOpen: (open: boolean) => void;
  }) => React.ReactNode;
};

export default function ContactPageClient({
  lang,
  children,
}: ContactPageClientProps) {
  const [isWhatsAppModalOpen, setIsWhatsAppModalOpen] = useState(false);

  return (
    <>
      {children({ isWhatsAppModalOpen, setIsWhatsAppModalOpen })}
      <WhatsAppPrompt
        isOpen={isWhatsAppModalOpen}
        onClose={() => setIsWhatsAppModalOpen(false)}
        lang={lang}
      />
    </>
  );
}
