import { formatPrice } from 'general/formatting' ; import { SYMBOL } from 'redux/api/bitmex/types' ; export default function buildOrderPresenter ( connected , wsCurrentPrice , status , trailOrderStatus , symbol ) { if ( ! connected || ! ! ! wsCurrentPrice ) { return { label : 'Not subscribed to order' , disabled : true } ; } if ( connected && wsCurrentPrice && trailOrderStatus === 'Order placed.' ) { return { label : 'Order is already placed' , disabled : true } ; } return { label : `Submit order at ${ formatPrice ( wsCurrentPrice , symbol ) }` , disabled : false } ; }