import * as React from 'react';
import CatalogoLayout from './catalogo-layout';
import { CatalogoService } from "../catalogo-service";

import { Context, ContainerContext } from './catalogo-context';
import { User } from '@quarks/auth-extension/lib/common';
import { Resource } from '@theia/core';

interface CatalogoContainerProps {
    options: any;
    service: CatalogoService;
    resource: Resource;
}

interface CatalogoContainerProps {

}

export class CatalogoContainer extends React.Component<CatalogoContainerProps, CatalogoContainerProps> {
    render() {
        const user: User = this.props.service.getUser();
        const providerValue: Context = {
            service: this.props.service,
            options: { ...this.props.options, user: user},
            resource: this.props.resource
        };
        // const panel = this.props.service.getConnectorPanelConfiguration();
        return (
            <ContainerContext.Provider value={providerValue}>
                <div className="magnetron-catalogo">
                    <CatalogoLayout />
                </div>
            </ContainerContext.Provider> 
        );
    }
}
