import type { ReactNode } from 'react'; import { VscListSelection, VscSymbolParameter } from 'react-icons/vsc'; import { PrismAsyncLight as SyntaxHighlighter } from 'react-syntax-highlighter'; import { vscDarkPlus } from 'react-syntax-highlighter/dist/cjs/styles/prism'; import { CodeListingSeparatorType } from './CodeListing'; import { CommentSection } from './Comment'; import { HyperlinkedText } from './HyperlinkedText'; import { Section } from './Section'; import { TypeParamTable } from './TypeParamTable'; import type { DocItem } from '~/DocModel/DocItem'; import { generateIcon } from '~/util/icon'; import type { TokenDocumentation, TypeParameterData } from '~/util/parse.server'; export interface DocContainerProps { name: string; kind: string; excerpt: string; summary?: ReturnType['summary']; children?: ReactNode; extendsTokens?: TokenDocumentation[] | null; implementsTokens?: TokenDocumentation[][]; typeParams?: TypeParameterData[]; } export function DocContainer({ name, kind, excerpt, summary, typeParams, children, extendsTokens, implementsTokens, }: DocContainerProps) { return (

{generateIcon(kind)} {name}

} title="Summary" className="dark:text-white mb-5"> {summary ? ( ) : (

No summary provided.

)}
{excerpt}
{extendsTokens?.length ? (

Extends

{CodeListingSeparatorType.Type}

) : null} {implementsTokens?.length ? (

Implements

{CodeListingSeparatorType.Type}

{implementsTokens.map((token, i) => ( <> {i < implementsTokens.length - 1 ? ', ' : ''} ))}

) : null}
{typeParams?.length ? (
} title="Type Parameters" className="dark:text-white" defaultClosed >
) : null}
{children}
); }