npm package: @redhat-cloud-services/frontend-components-inventory
Description: Inventory components for RedHat Cloud Services project.
Latest version: 3.4.0

# RedHat Cloud Services frontend components - inventory
[![npm version](https://badge.fury.io/js/%40redhat-cloud-services%2Ffrontend-components-inventory.svg)](https://badge.fury.io/js/%40redhat-cloud-services%2Ffrontend-components-inventory)

This package is hot loaded via [insights-chrome](https://github.com/RedHatInsights/insights-chrome#readme) and exports new components for inventory table and detail. It also exports redux reducers and actions so usage is as simple as possible.

## !!!Deprecated package!!!

This package is deprecated, please do not use it anymore! We are no longer supporting this package because we moved it to inventory application and exporting inventory components trough federated modules.

If you want to use inventory component, either use [Async inventory components](https://github.com/RedHatInsights/frontend-components/tree/master/packages/components/src/Inventory) or use directly [Async component](https://github.com/RedHatInsights/frontend-components/tree/master/packages/components/src/AsyncComponent)

1) Usage with `Async inventory component`
```JS
import React from 'react';
import { InventoryTable } from '@redhat-cloud-services/frontend-components/Inventory';

const Cmp = () => <InventoryTable />;

export default Cmp;
```

2) Usage with `Async component`
```JS
import React from 'react';
import { useHistory } from 'react-router-dom';
import { useStore } from 'react-redux';
import AsyncComponent from '@redhat-cloud-services/frontend-components/AsyncComponent';

const Cmp = () => {
  const store = useStore();
  const history = useHistory();
  return (
    <AsyncComponent
      store={store}
      history={history}
      appName="inventory"
      module={`./InventoryTable`}
      fallback="Loading"
      ref={innerRef}
      {...props}
    />
  );
}

export default Cmp;
```
## Installation
You shouldn't install this package directly to your project, but if you really have to install it either with npm
```bash
npm i -S @redhat-cloud-services/frontend-components-inventory
```

or with yarn
```bash
yarn add @redhat-cloud-services/frontend-components-inventory
```

This package is dependent on [@redhat-cloud-services/frontend-components-utilities](https://www.npmjs.com/package/@redhat-cloud-services/frontend-components-utilities), [@redhat-cloud-services/frontend-components](https://www.npmjs.com/package/@redhat-cloud-services/frontend-components) and [@redhat-cloud-services/host-inventory-client](https://www.npmjs.com/package/@redhat-cloud-services/host-inventory-client) will automatically install them trough direct dependencies.


## Documentation Links

* Components
  * [inventory](https://github.com/RedHatInsights/frontend-components/blob/master/packages/inventory/doc/inventory.md)
    * [props](https://github.com/RedHatInsights/frontend-components/blob/master/packages/inventory/doc/props.md)
    * [custom fetch function](https://github.com/RedHatInsights/frontend-components/blob/master/packages/inventory/doc/custom_fetch.md)
    * [hide filters](https://github.com/RedHatInsights/frontend-components/blob/master/packages/inventory/doc/hide_filters.md)
  * [inventory_header](https://github.com/RedHatInsights/frontend-components/blob/master/packages/inventory/doc/inventory_header.md)