import { EffectCallback, MutableRefObject } from 'react'
import { TokenSectionHeaderProps } from 'uniswap/src/components/TokenSelector/TokenSectionHeader'
import { TokenOption, TokenSection, TokenSelectorListSections } from 'uniswap/src/components/TokenSelector/types'
import { NotImplementedError } from 'utilities/src/errors'

export interface TokenSectionBaseListRef {
  scrollToLocation: (params: { itemIndex: number; sectionIndex: number; animated: boolean }) => void
}

export type SectionRowInfo = { section: TokenSectionHeaderProps }

export interface ItemRowInfo {
  item: TokenOption | TokenOption[]
  section: TokenSection
  index: number
}

export interface TokenSectionBaseListProps {
  sectionListRef?: MutableRefObject<TokenSectionBaseListRef | undefined>
  ListEmptyComponent?: JSX.Element
  focusHook?: (callback: EffectCallback) => void
  keyExtractor?: (item: TokenOption | TokenOption[], index: number) => string
  renderItem: (info: ItemRowInfo) => JSX.Element | null
  renderSectionHeader?: (info: SectionRowInfo) => JSX.Element
  sections: TokenSelectorListSections
}

export function TokenSectionBaseList(_props: TokenSectionBaseListProps): JSX.Element {
  throw new NotImplementedError('TokenSectionBaseList')
}
