'use client';
// ConfirmPreviewImages — 确认预览页已选图片网格
import { ImageCandidate } from '@/types/index';

interface ConfirmPreviewImagesProps {
  images: ImageCandidate[];
}

export function ConfirmPreviewImages({ images }: ConfirmPreviewImagesProps) {
  return (
    <div>
      <h3 className="text-sm font-semibold text-text-secondary mb-3">已选图</h3>
      {images.length === 0 ? (
        <p className="text-text-tertiary text-sm">暂无选中图片</p>
      ) : (
        <div className="grid grid-cols-2 gap-2">
          {images.map((img) => (
            <div key={img.candidate_id} className="rounded-xl overflow-hidden border border-border-default">
              <img src={img.url} alt={`选中图片·${img.role}`}
                className="w-full aspect-square object-cover" />
              <p className="text-xs text-text-secondary text-center py-1">{img.role}</p>
            </div>
          ))}
        </div>
      )}
    </div>
  );
}
