import { type NavEntry as NavEntryType } from '../../config'

type Props = {
  entry: NavEntryType
  Anchor: React.ElementType
  Action: React.ElementType
  Parent: React.ElementType
}
export function NavEntry({ entry, Anchor, Action, Parent }: Props) {
  if ('url' in entry) {
    return <Anchor entry={entry} />
  }
  if ('onClick' in entry) {
    return <Action entry={entry} />
  }
  return <Parent entry={entry} />
}
