"use client"

import { useRef } from "react"

import { StickyElementNameEnum } from "@/stores/sticky-position"

import MeetingPackageWidget from "@/components/MeetingPackageWidget"
import useStickyPosition from "@/hooks/useStickyPosition"

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

interface StickyMeetingPackageWidgetProps {
  destination?: string
}

export default function StickyMeetingPackageWidget({
  destination,
}: StickyMeetingPackageWidgetProps) {
  const ref = useRef<HTMLDivElement>(null)
  useStickyPosition({
    ref,
    name: StickyElementNameEnum.MEETING_PACKAGE_WIDGET,
  })

  return (
    <div ref={ref} className={styles.wrapper}>
      <MeetingPackageWidget destination={destination} />
    </div>
  )
}
