import { Command } from 'cmdk'; import type { AlgoliaItemType } from '../types'; import { getContentHighlightHTML, getHighlightHTML, openLink } from '../utils'; import { FootnoteSection } from './FootnoteSection'; import { ExternalLinkIcon, ReactIcon } from './icons'; import { itemStyle, contentStyle, footnoteStyle, itemIconWrapperStyle } from './styles'; import { CALLOUT, FOOTNOTE } from '~/ui/components/Text'; type Props = { item: AlgoliaItemType; onSelect?: () => void; }; export const RNDocsItem = ({ item, onSelect }: Props) => { const { lvl0, lvl1, lvl2, lvl3, lvl4 } = item.hierarchy; return ( { openLink(item.url, true); onSelect && onSelect(); }}>
{lvl4 && ( <> )} {!lvl4 && lvl3 && ( <> )} {!lvl3 && lvl2 && ( <> )} {!lvl3 && !lvl2 && lvl1 && ( <> )} {!lvl3 && !lvl2 && !lvl1 && lvl0 && ( )}
); };