import React from 'react';
import {withNamespaces} from "react-i18next";

import {injectSheet} from '../../lib/theme';
import ProductCreate from './ProductCreate';

const styling = () => ({});

class Content extends React.Component {
    render() {
        const {t} = this.props;
        return (
            <div>
                <h1>{t('group.title')}</h1>
                {this.props.match.params.group ?
                    <p>{t('group.choosen-group-is')} {this.props.match.params.group}</p> :
                    <p>{t('group.choose-group')}</p>}

                {this.props.match.params.group ?
                    <React.Fragment>
                        <h2>{t('group.create-product-in-group')}</h2>
                        <ProductCreate group={this.props.match.params.group}/>
                    </React.Fragment> : null}
            </div>
        );
    }
}

export default withNamespaces('page--shop')(injectSheet(styling)(Content));
