feat(29-02): update ComparisonTable, CatalogSearchOverlay, ImageUpload

Replace object-cover with GearImage across ComparisonTable,
CatalogSearchOverlay (2 instances), and ImageUpload preview.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-12 20:00:46 +02:00
parent 05c09182fd
commit 91846b5ca2
3 changed files with 41 additions and 13 deletions

View File

@@ -1,9 +1,11 @@
import { useRef, useState } from "react";
import { apiUpload } from "../lib/api";
import { GearImage, imageContainerBg } from "./GearImage";
interface ImageUploadProps {
value: string | null;
imageUrl?: string | null;
dominantColor?: string | null;
onChange: (filename: string | null) => void;
}
@@ -13,6 +15,7 @@ const ACCEPTED_TYPES = ["image/jpeg", "image/png", "image/webp"];
export function ImageUpload({
value: _value,
imageUrl,
dominantColor,
onChange,
}: ImageUploadProps) {
const [uploading, setUploading] = useState(false);
@@ -70,13 +73,18 @@ export function ImageUpload({
<div
onClick={() => inputRef.current?.click()}
className="relative w-full aspect-[4/3] rounded-xl overflow-hidden cursor-pointer group"
style={{
backgroundColor: displayUrl
? imageContainerBg(dominantColor)
: undefined,
}}
>
{displayUrl ? (
<>
<img
<GearImage
src={displayUrl}
alt="Item"
className="w-full h-full object-cover"
dominantColor={dominantColor}
/>
{/* Remove button */}
<button