import React from "react"; import { icons } from "../../icons"; import { DropButton } from "./widget"; import { ToolAttr } from "../utils"; export function TextHeight(props: { attr: ToolAttr }) { const lang = props.attr.lang; return ( { const attr = props.attr; let str = attr.currentState.inlineStyle?.fontSize || ""; let m = str.match(/\d+/); if (m) { let size = parseInt(m[0]); return size; } else { return null; } }} onSelect={(item) => { const attr = props.attr; attr.event.emit(attr.editEvent.fontSize, item.value ? `${item.value}em` : null); }} > ); }