import { Token, TokenGroup } from "../../../types/Token"; import { toCamelCaseFromTokens } from '../../string'; import { HtmlButtonElement } from "../../../types/html/HtmlButtonElement"; import { HtmlElementType } from "../../../types/html/HtmlElementType"; export function processButton( classes: string[], body: Token[] ): HtmlButtonElement | null { const text = body.find( x => x.group === TokenGroup.Custom && x.section === 'string' ); if( !text ) return null; return { type: 'html', tag: HtmlElementType.Button, classes, text: text.key } }