import React from 'react';

import { BrowserRouter } from 'react-router-dom';

import { HiroGraph } from './HiroGraph';
import { Orm } from '../contexts';

interface HiroAppRootProps {
  orm?: Orm;
  children?: any;
}

export const HiroAppRoot: React.FC<HiroAppRootProps> = ({ orm, children }) => (
  <BrowserRouter>
    {orm ? <HiroGraph orm={orm}>{children}</HiroGraph> : children}
  </BrowserRouter>
);
