import React from 'react'; import { InlineCode } from '~/components/base/code'; import { H2, H3Code } from '~/components/plugins/Headings'; import { ConstantDefinitionData } from '~/components/plugins/api/APIDataTypes'; import { CommentTextBlock } from '~/components/plugins/api/APISectionUtils'; export type APISectionConstantsProps = { data: ConstantDefinitionData[]; apiName?: string; }; const renderConstant = ( { name, comment }: ConstantDefinitionData, apiName?: string ): JSX.Element => (
{apiName ? `${apiName}.` : ''} {name}
); const APISectionConstants: React.FC = ({ data, apiName }) => data?.length ? ( <>

Constants

{data.map(constant => renderConstant(constant, apiName))} ) : null; export default APISectionConstants;