feat: use ProductImage in ProductDetailPageClient
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
import { useEffect, useMemo, useState } from "react";
|
import { useEffect, useMemo, useState } from "react";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
|
import { ProductImage } from './ProductImage';
|
||||||
import PlatformSwitcher from "./PlatformSwitcher";
|
import PlatformSwitcher from "./PlatformSwitcher";
|
||||||
|
|
||||||
const API_BASE_URL = process.env.NEXT_PUBLIC_API_BASE_URL ?? "";
|
const API_BASE_URL = process.env.NEXT_PUBLIC_API_BASE_URL ?? "";
|
||||||
@@ -149,14 +150,11 @@ export default function ProductDetailPageClient(props: {
|
|||||||
<div className="flex flex-col gap-6 md:flex-row">
|
<div className="flex flex-col gap-6 md:flex-row">
|
||||||
<div className="w-full md:w-72">
|
<div className="w-full md:w-72">
|
||||||
<div className="aspect-square overflow-hidden rounded-lg border border-zinc-800 bg-black/30">
|
<div className="aspect-square overflow-hidden rounded-lg border border-zinc-800 bg-black/30">
|
||||||
{/* eslint-disable-next-line @next/next/no-img-element */}
|
<ProductImage
|
||||||
{p.imageUrl ? (
|
src={p.imageUrl}
|
||||||
<img src={p.imageUrl} alt={p.name} className="h-full w-full object-cover" />
|
alt={p.name}
|
||||||
) : (
|
className="h-full w-full object-cover"
|
||||||
<div className="h-full w-full grid place-items-center text-sm text-zinc-600">
|
/>
|
||||||
No image
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user