Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
@skava/ui / src / components / abstractions / ShoppingList / ShoppingList.tsx
Size: Mime:
import React from 'react'
import { isArray } from 'exotic'
import { defaultRenderShoppingListItem } from './renderProps'
import { ShoppingListProps } from './typings'

class ShoppingList extends React.Component<ShoppingListProps> {
  static defaultProps = {
    className: '',
    renderShoppingListItem: defaultRenderShoppingListItem,
  }

  render() {
    const {
      shoppingList,
      renderShoppingListItem,
      ...remainingProps
    } = this.props

    const view =
      isArray(shoppingList) &&
      shoppingList.map((item, index) =>
        renderShoppingListItem({ item, index, ...remainingProps })
      )
    return view
  }
}

export { ShoppingList }
export default ShoppingList