import { Box, type DOMElement, Newline, Text } from "src/ink"; import React, { forwardRef } from "react"; export interface ImageBoxProps { width: number | string; height: number | string; // 字符高度(占位) alt?: string; error?: boolean; loaded?: boolean; children?: React.ReactNode; } const ImageBox = forwardRef(function ImageBox( { width, height, alt, error, loaded, children }, ref, ) { return ( {loaded && children ? ( children ) : ( {alt ? ( {alt} ) : error ? ( X Load failed ) : ( Loading... )} )} ); }); export default ImageBox;