/** * 价格的结尾dom */ import React, { FC, useCallback } from "react"; import CustomToolTip from "@components/PlaceOrder/CustomToolTip"; import clsx from "clsx"; import { LimitMarketSelect } from "./LimitMarketSelect"; import { OrderTypeEnum } from "@shared/types"; interface SuffixPriceProps { /** 是否条件单 */ condition?: boolean; showNew?: boolean; /** 点击最新 */ onClickNewPrice?: () => void; unit?: string; triggerValue?: OrderTypeEnum; onTriggerTypeChange?: (val: OrderTypeEnum) => void; } export const SuffixPrice: FC = props => { const { condition, unit, showNew, onClickNewPrice } = props; const onNewPrice = useCallback( (event?: React.MouseEvent) => { event?.stopPropagation(); props.onClickNewPrice?.(); }, [onClickNewPrice] ); return (
{showNew ? (
最新
) : ( "" )} {condition ? ( ) : ( {unit} )}
); }; SuffixPrice.defaultProps = { condition: false, showNew: false, onClickNewPrice: () => {}, unit: "" };