import React from 'react';
import ReactDOM from 'react-dom';
import { Provider } from 'react-redux';

import Dashboard from "bitbucket/internal/feature/dashboard/dashboard";
import paging from 'bitbucket/internal/feature/dashboard/reducers/paging';
import repositories from 'bitbucket/internal/feature/dashboard/reducers/repositories';
import ui from 'bitbucket/internal/feature/dashboard/reducers/ui';
import { customCreateStore } from 'bitbucket/internal/util/redux';

export function onReady(el, user) {

    const store = customCreateStore({
        paging,
        repositories,
        ui,
    });

    ReactDOM.render((
        <Provider store={store}>
            <Dashboard user={user} />
        </Provider>), el);
}
