import * as _ from 'lodash';
import { Table } from 'antd';
import * as React from 'react';
import { compose } from 'redux';
import { Query } from 'react-apollo';
import { connect } from 'react-fela';

import { usegalleryExtensionQuery } from '../components/generated-model';
import { Extension } from '../components/ExtensionView';

export interface IExtensionViewComponentProps {
    extensionID: string;
}

export const ExtensionView = (props: IExtensionViewComponentProps) =>  {
        const { data, loading, error } = usegalleryExtensionQuery({variables: { extensionID: props.extensionID}});

        return (
                <Extension loading={loading} extension={_.get(data, 'extension')} />
        );
};
