index.tsx 806 Bytes
import { Image, type ImageProps } from 'antd';

export type UImageProps = ImageProps;

/**
 * 项目图片组件:antd Image 的 U* 出口。
 *
 * 默认开启点击预览大图(antd 原生 preview 带缩放/旋转/翻页),
 * 对齐源系统列表缩略图点击弹 image-viewer 的行为。
 *
 * 子应用禁止直引 antd(eslint no-restricted-imports 门禁),统一从 @uj/ui 消费。
 * 缩略图尺寸/裁剪由调用方传 width/height + classNames.image + styles.image 控制;
 * antd 自带 `.ant-image-img { width:100%; height:auto }` 与业务 class 同特异性,
 * 故 object-fit 走 styles.image(inline)确保覆盖,不依赖 CSS 注入顺序。
 */
export function UImage({ preview = true, ...rest }: UImageProps) {
  return <Image preview={preview} {...rest} />;
}