import { observer } from 'mobx-react';
import * as React from 'react';
import { SelectionManager } from '../util/SelectionManager';
import './ComponentDecorations.scss';

@observer
export class ComponentDecorations extends React.Component<{ boundsTop: number; boundsLeft: number }, { value: string }> {
    // eslint-disable-next-line no-use-before-define
    static Instance: ComponentDecorations;

    render() {
        const seldoc = SelectionManager.Views.lastElement();
        return seldoc?.ComponentView?.componentUI?.(this.props.boundsLeft, this.props.boundsTop) ?? null;
    }
}
