Sha256: 5eaccd6b6c4b98916b641e63a742e34145a3433a65042c3c21ae0a9d656c2ed7

Contents?: true

Size: 1.09 KB

Versions: 1

Compression:

Stored size: 1.09 KB

Contents

import PropTypes from 'prop-types';
import React from 'react';
import { Route, Switch, Redirect } from 'react-router-dom';
import { route } from './helpers';
import EmptyPage from './SubTabs/EmptyPage';
import Reports from './SubTabs/Reports';

const SecondaryTabRoutes = ({ hostName, hostInfo, status }) => (
  <Switch>
    <Route path={route('reports')}>
      {hostName ? (
        <Reports hostName={hostName} hostInfo={hostInfo} status={status} />
      ) : (
        <EmptyPage header="Reports" />
      )}
    </Route>
    <Route path={route('assigned')}>
      <EmptyPage header="Assigned classes" />
    </Route>
    <Route path={route('smart-classes')}>
      <EmptyPage header="Smart class parameters" />
    </Route>
    <Route path={route('yaml')}>
      <EmptyPage header="YAML" />
    </Route>
    <Redirect to={route('reports')} />
  </Switch>
);

SecondaryTabRoutes.propTypes = {
  hostName: PropTypes.string,
  hostInfo: PropTypes.object,
  status: PropTypes.string,
};

SecondaryTabRoutes.defaultProps = {
  hostName: '',
  hostInfo: {},
  status: undefined,
};

export default SecondaryTabRoutes;

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
foreman_puppet-4.0.0 webpack/src/Extends/Host/PuppetTab/Routes.js