Repository URL to install this package:
|
Version:
2.1.0 ▾
|
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,
}