import React from "react"; import { Spin, type SpinProps } from "antd"; export interface WhenProps extends SpinProps { /** * 条件 */ test: boolean; /** * 成功内容 */ children?: React.ReactNode; } export const When = React.forwardRef( ({ test, children, ...props }, ref) => { if (test) { return
{children}
; } return ; } );