'use strict' ; import React , { forwardRef } from 'react' ; import { MathViewProps } from '../../common' ; import FragmentedMathView from './FragmentedMathView' ; import MathView from '../MathView' ; export interface MathViewControllerProps extends MathViewProps { action : 'edit' | 'none' ; } param props param ref const MathViewController = forwardRef ( ( props , ref ) => { return props . action === 'edit' ? < FragmentedMathView { ... props } ref = { ref } / > : < MathView { ... props } ref = { ref } / > ; } ) ; MathViewController . defaultProps = { action : 'none' } as Partial < MathViewControllerProps > ; export default MathViewController ;