import type Feather from '@expo/vector-icons/Feather'

// One icon vocabulary across both platforms. Feather is already pulled in via
// @expo/vector-icons and was the Android source — picking it removes the
// SF Symbols dependency without adding a new icon library.
export type IconName = keyof typeof Feather.glyphMap

// Internal shapes consumed by the low-level MenuBar primitives (IconButton,
// OverflowButton, PrimaryButton, SegmentsRow, SearchField). Intent renderers
// adapt intents into these shapes. Consumers should describe intents in
// IntentMenuSpec (see ./intents.ts), not these types directly.

export interface MenuAction {
  icon: IconName
  accessibilityLabel: string
  accessibilityHint?: string
  onPress: () => void
  disabled?: boolean
}

export interface MenuPrimary extends MenuAction {
  selected?: boolean
}

export interface MenuOverflowItem {
  label: string
  icon?: IconName
  onPress: () => void
  destructive?: boolean
  disabled?: boolean
  isOn?: boolean
}

export interface MenuOverflow {
  accessibilityLabel?: string
  items: MenuOverflowItem[]
}

export interface MenuSegmentOption {
  value: string
  label: string
  icon?: IconName
}

export interface MenuSegments {
  value: string
  options: MenuSegmentOption[]
  onChange: (value: string) => void
  accessibilityLabel?: string
}

export interface MenuSearch {
  placeholder: string
  value: string
  onChangeText: (text: string) => void
}

export interface MenuHandle {
  searchActive: boolean
  setSearchActive: (active: boolean) => void
}
