/** * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * */ import type {Ref, RefObject} from 'react'; import './EquationEditor.css'; import * as React from 'react'; import {ChangeEvent, forwardRef} from 'react'; type BaseEquationEditorProps = { equation: string; inline: boolean; setEquation: (equation: string) => void; }; function EquationEditor( {equation, setEquation, inline}: BaseEquationEditorProps, forwardedRef: Ref, ): JSX.Element { const onChange = (event: ChangeEvent) => { setEquation((event.target as HTMLInputElement).value); }; return inline && forwardedRef instanceof HTMLInputElement ? ( $ } /> $ ) : (
{'$$\n'}