import {NativeModules, Platform} from 'react-native';

// Detect TV via native module constant (checks leanback, TV hardware, UI mode, Fire TV model)
export const IS_TV: boolean =
  Platform.OS === 'android' && NativeModules.TorrentStreamModule?.isTV === true;

// Android remote key codes
export const TVKeys = {
  DPAD_UP: 19,
  DPAD_DOWN: 20,
  DPAD_LEFT: 21,
  DPAD_RIGHT: 22,
  DPAD_CENTER: 23,
  ENTER: 66,
  BACK: 4,
  PLAY_PAUSE: 85,
  MEDIA_PLAY: 126,
  MEDIA_PAUSE: 127,
  FAST_FORWARD: 90,
  REWIND: 89,
  MENU: 82,
} as const;

// Focus highlight color for TV navigation
export const TV_FOCUS_COLOR = '#6C4FF0';
export const TV_FOCUS_BORDER = 2.5;
