30 lines
572 B
TypeScript
30 lines
572 B
TypeScript
'use client';
|
|
|
|
import React from 'react';
|
|
|
|
interface ProductCardOneProps {
|
|
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>
|
|
);
|
|
};
|
|
|
|
export default ProductCardOne;
|