Update src/components/sections/product/ProductCardOne.tsx
This commit is contained in:
@@ -1,15 +1,25 @@
|
||||
'use client';
|
||||
|
||||
import React from 'react';
|
||||
import { Product } from '@/lib/api/product';
|
||||
|
||||
interface ProductCardOneProps {
|
||||
product: Product;
|
||||
product?: {
|
||||
id: string;
|
||||
name: string;
|
||||
price: string;
|
||||
imageSrc?: string;
|
||||
imageAlt?: string;
|
||||
};
|
||||
}
|
||||
|
||||
const ProductCardOne: React.FC<ProductCardOneProps> = ({ product }) => {
|
||||
if (!product) return null;
|
||||
|
||||
return (
|
||||
<div className="product-card-one">
|
||||
{product.imageSrc && (
|
||||
<img src={product.imageSrc} alt={product.imageAlt || 'Product'} />
|
||||
)}
|
||||
<h3>{product.name}</h3>
|
||||
<p>{product.price}</p>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user