import React from 'react';
import AsyncData from '../shared/AsyncData';
import EntityForm from '../shared/EntityForm';

export default ({ history, match }) => {
    const entityId = history.location.pathname.slice(1).split('/')[0];

    return (
        <AsyncData
            renderData={(data) => <EntityForm history={history} data={data} entityId={entityId} />}
            path={'fetchItem'}
            requestData={[entityId, match.params.id]}
        />
    );
};
