import { addDecimal } from '@vegaprotocol/react-helpers'; import { FormGroup, Input } from '@vegaprotocol/ui-toolkit'; import { Market_market } from '@vegaprotocol/graphql'; import { TransactionStatus } from './deal-ticket'; import { SideSelector } from './side-selector'; import { SubmitButton } from './submit-button'; import { TimeInForceSelector } from './time-in-force-selector'; import { TypeSelector } from './type-selector'; import { Order } from './use-order-state'; interface DealTicketMarketProps { order: Order; updateOrder: (order: Partial) => void; transactionStatus: TransactionStatus; market: Market_market; } export const DealTicketMarket = ({ order, updateOrder, transactionStatus, market, }: DealTicketMarketProps) => { return ( <> updateOrder({ type })} /> updateOrder({ side })} />
updateOrder({ size: e.target.value })} className="w-full" type="number" data-testid="order-size" />
@
{market.depth.lastTrade ? ( <> ~{addDecimal(market.depth.lastTrade.price, market.decimalPlaces)}{' '} {market.tradableInstrument.instrument.product.quoteName} ) : ( '-' )}
updateOrder({ timeInForce })} /> ); };