'use client';

import { useState, useEffect } from 'react';

/**
 * Hook to check if component is mounted
 * Useful for avoiding hydration mismatches with client-only content
 *
 * @returns Whether the component is mounted
 */
export function useMounted(): boolean {
  const [mounted, setMounted] = useState(false);

  useEffect(() => {
    setMounted(true);
  }, []);

  return mounted;
}
