import { Image, Space } from 'antd';

interface Props {
  urls: string[];
  width?: number;
}

export function ImagePreview({ urls, width = 100 }: Props) {
  if (!urls || urls.length === 0) return null;

  return (
    <Image.PreviewGroup>
      <Space size={8} wrap>
        {urls.map((url, idx) => (
          <Image
            key={idx}
            src={url}
            width={width}
            style={{ borderRadius: 4, objectFit: 'cover' }}
          />
        ))}
      </Space>
    </Image.PreviewGroup>
  );
}
