import * as React from "react";
import { FieldsControl as CoreFieldsControl } from "../../Controls/FieldsControl";
import { FieldsControl as CorrespondenceFieldsControl } from "./Correspondence/FieldsControl";
import { FieldsControl as TaskFieldsControl } from "./Task/FieldsControl";
import { FieldsControl as MeetingTemplateFieldsControl } from "./MeetingTemplate/FieldsControl";
import { FieldsControl as MeetingFieldsControl } from "./Meeting/FieldsControl";

export class FieldsControl extends React.Component<any, any> {
    // private fieldsControl: FieldsControl;
    constructor(props: any) {
        super(props);
    }

    public render(): JSX.Element {
        return (
            this.props.Record.entityId == 14 ?
                <CorrespondenceFieldsControl  {...this.props}></CorrespondenceFieldsControl> :
                (
                    this.props.Record.entityId == 24 ?
                        <TaskFieldsControl  {...this.props}></TaskFieldsControl> :
                        (
                            this.props.Record.entityId == 32 ?
                                <MeetingTemplateFieldsControl  {...this.props}></MeetingTemplateFieldsControl> :
                                (
                                    this.props.Record.entityId == 33 ?
                                        <MeetingFieldsControl  {...this.props}></MeetingFieldsControl> :
                                        <CoreFieldsControl  {...this.props}></CoreFieldsControl>)))
        );
    }
}