import { FormGroup, Input } from '@vegaprotocol/ui-toolkit'; import { Order } from './use-order-state'; import { formatForInput } from '@vegaprotocol/react-helpers'; interface ExpirySelectorProps { order: Order; onSelect: (expiration: Date | null) => void; } export const ExpirySelector = ({ order, onSelect }: ExpirySelectorProps) => { const date = order.expiration ? new Date(order.expiration) : new Date(); const dateFormatted = formatForInput(date); const minDate = formatForInput(date); return ( onSelect(new Date(e.target.value))} min={minDate} /> ); };