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    
Size: Mime:
import React from 'react'
import { isObj } from 'exotic'
import { wording } from 'src/words'
import { MaterialIcon } from '@skava/ui/dist/components/atoms/MaterialIcon'
import { StyledDetailedList, StyledButtonWithIcon } from './styled'
import { OrderStatusProps } from './typings'

function defaultRenderOrderStatus(props: OrderStatusProps) {
  const { orderStatusConfig } = props
  return <StyledDetailedList list={orderStatusConfig} />
}

function defaultRenderPrintIcon(props: OrderStatusProps) {
  return <MaterialIcon type={'print_icon'} />
}

function defaultRenderOrderDetails(props: OrderStatusProps) {
  const { state } = props
  const iconType = isObj(state) && state.isExpanded ? wording.up : wording.down
  const handleClick = isObj(state) === true ? state.handleToggle : false
  return (
    <StyledButtonWithIcon
      iconAlignType={'suffix'}
      text={'Order Details'}
      iconType={iconType}
      onClick={handleClick}
    />
  )
}

export {
  defaultRenderOrderDetails,
  defaultRenderOrderStatus,
  defaultRenderPrintIcon,
}