import { Fragment } from 'react'; import Link from '@docusaurus/Link'; import { useRequiredReflection } from '../hooks/useReflection'; import type { TSDDeclarationReflection } from '../types'; import { escapeMdx } from '../utils/helpers'; import { AnchorLink } from './AnchorLink'; import { Icon } from './Icon'; export interface IndexChildProps { id: number; } function IndexChild({ id }: IndexChildProps) { const reflection = useRequiredReflection(id); return (
  • {escapeMdx(reflection.name)}
  • ); } export interface IndexProps { reflection: TSDDeclarationReflection; } export function Index({ reflection }: IndexProps) { if (reflection.categories && reflection.categories.length > 0) { return (

    Index

    {reflection.categories.map((category) => (

    {category.title === '__CATEGORY__' ? 'Other' : category.title}

      {category.children?.map((child) => )}
    ))}
    ); } if (reflection.groups && reflection.groups.length > 0) { return (

    Index

    {reflection.groups.map((group) => (
    {group.categories && group.categories.length > 0 ? ( group.categories.map((category) => (

    {category.title === '__CATEGORY__' ? group.title : category.title}

      {category.children?.map((child) => )}
    )) ) : ( <>

    {group.title}

      {group.children?.map((child) => )}
    )}
    ))}
    ); } return null; }