import { FiLink } from 'react-icons/fi'; import { CommentSection } from './Comment'; import { HyperlinkedText } from './HyperlinkedText'; import { ParameterTable } from './ParameterTable'; import type { DocMethod } from '~/DocModel/DocMethod'; import type { DocMethodSignature } from '~/DocModel/DocMethodSignature'; type MethodResolvable = ReturnType | ReturnType; export interface MethodItemProps { data: MethodResolvable; } function getShorthandName(data: MethodResolvable) { return `${data.name}(${data.parameters.reduce((prev, cur, index) => { if (index === 0) { return `${prev}${cur.name}`; } return `${prev}, ${cur.name}`; }, '')})`; } function onAnchorClick() { console.log('anchor clicked'); // Todo implement jump-to links } export function MethodItem({ data }: MethodItemProps) { return (

{`${getShorthandName(data)}`}

:

{data.summary && } {data.parameters.length ? : null}
); }