import { computed } from 'mobx';
import { observer } from 'mobx-react';
import { Doc } from '../../../../fields/Doc';
import { emptyFunction, returnEmptyDoclist, returnEmptyFilter, returnFalse, returnOne, returnTrue } from '../../../../Utils';
import { Transform } from '../../../util/Transform';
import { ViewBoxBaseComponent } from '../../DocComponent';
import { DefaultStyleProvider } from '../../StyleProvider';
import { DocumentView, DocumentViewInternal } from '../DocumentView';
import { FieldView, FieldViewProps } from '../FieldView';
import React = require('react');

@observer
export class ImportElementBox extends ViewBoxBaseComponent<FieldViewProps>() {
    public static LayoutString(fieldKey: string) {
        return FieldView.LayoutString(ImportElementBox, fieldKey);
    }

    screenToLocalXf = () => this.props.ScreenToLocalTransform().scale(1 * (this.props.NativeDimScaling?.() || 1));
    @computed get mainItem() {
        return (
            <div style={{ backgroundColor: 'pink' }}>
                <DocumentView
                    {...this.props} //
                    LayoutTemplateString={undefined}
                    Document={this.rootDoc}
                    isContentActive={returnFalse}
                    DataDoc={undefined}
                    addDocument={returnFalse}
                    ScreenToLocalTransform={this.screenToLocalXf}
                    hideResizeHandles={true}
                />
            </div>
        );
    }
    render() {
        return !(this.rootDoc instanceof Doc) ? null : this.mainItem;
    }
}
