import { useEffect } from 'react'
import { emit } from './inputBus'

export function usePoseInput(): void {
  useEffect(() => {
    const emitAction = (action: Parameters<typeof emit>[0]) => {
      emit(action)
    }

    // MediaPipe integration point:
    // Convert detected pose/gesture events into GameAction values and call `emitAction(action)`.
    // Example mapping idea: swipe-left -> 'LEFT', swipe-right -> 'RIGHT',
    // hand-raise -> 'BUTTON_A', cancel gesture -> 'BUTTON_B'.
    // Keep all MediaPipe-specific setup/teardown in this hook so UI components remain input-agnostic.
    void emitAction

    return () => {
      // Cleanup MediaPipe resources/listeners here when integration is added.
    }
  }, [])
}
