import React from 'react';
import { SizedBox, Container, Padding, Column } from '@dynshift/layr';
const products = [
{
id: 1,
title: 'Wireless Headphones',
description: 'Premium noise-cancelling headphones with 30-hour battery life.',
image: 'https://images.unsplash.com/photo-1505740420928-5e560c06d30e?w=400&h=300&fit=crop',
price: '$299'
},
{
id: 2,
title: 'Smart Watch',
description: 'Track your fitness goals with advanced health monitoring.',
image: 'https://images.unsplash.com/photo-1523275335684-37898b6baf30?w=400&h=300&fit=crop',
price: '$399'
},
{
id: 3,
title: 'Laptop Stand',
description: 'Ergonomic aluminum stand for better posture and cooling.',
image: 'https://images.unsplash.com/photo-1629317480826-910f729d1709?q=80&w=1974&fit=crop',
price: '$79'
},
{
id: 4,
title: 'Mechanical Keyboard',
description: 'RGB backlit keyboard with customizable switches.',
image: 'https://images.unsplash.com/photo-1625948515291-69613efd103f?w=400&h=300&fit=crop',
price: '$149'
},
{
id: 5,
title: 'Wireless Mouse',
description: 'Ergonomic design with long battery.',
image: 'https://images.unsplash.com/photo-1527814050087-3793815479db?w=400&h=300&fit=crop',
price: '$69'
},
{
id: 6,
title: 'USB-C Hub',
description: 'Multi-port adapter with 4K HDMI and fast charging.',
image: 'https://images.unsplash.com/photo-1616578273461-3a99ce422de6?q=80&w=764&fit=crop',
price: '$49'
}
];
const ProductGrid: React.FC = () => {
return (
<div style={{
padding: '32px',
maxWidth: '1200px',
margin: '0 auto'
}}>
<h1 style={{
fontSize: '2rem',
fontWeight: 700,
marginBottom: '32px',
color: '#fdfdfd'
}}>
Featured Products
</h1>
<div style={{
display: 'grid',
gridTemplateColumns: 'repeat(auto-fit, minmax(300px, 1fr))',
gap: '24px'
}}>
{products.map(product => (
<SizedBox key={product.id} width="100%" height={380}>
<Container
decoration={{
color: '#ffffff',
borderRadius: 12,
boxShadow: [{
color: 'rgba(0, 0, 0, 0.1)',
offset: { dx: 0, dy: 2 },
blurRadius: 8,
spreadRadius: 0
}],
border: {
width: 1,
color: '#e5e7eb'
}
}}
style={{
cursor: 'pointer',
transition: 'transform 0.2s, box-shadow 0.2s'
}}
onMouseEnter={(e) => {
e.currentTarget.style.transform = 'translateY(-4px)';
e.currentTarget.style.boxShadow = '0 8px 16px rgba(0, 0, 0, 0.15)';
}}
onMouseLeave={(e) => {
e.currentTarget.style.transform = 'translateY(0)';
e.currentTarget.style.boxShadow = '0 2px 8px rgba(0, 0, 0, 0.1)';
}}
>
<Column>
{}
<Container
width="100%"
height={200}
decoration={{
image: {
image: product.image,
fit: 'cover'
},
borderRadius: {
topLeft: 12,
topRight: 12
}
}}
/>
{}
<Padding padding={20}>
<Column spacing={12}>
<div style={{
display: 'flex',
justifyContent: 'space-between',
alignItems: 'flex-start'
}}>
<h3 style={{
margin: 0,
fontSize: '1.125rem',
fontWeight: 600,
color: '#1f2937',
flex: 1
}}>
{product.title}
</h3>
<span style={{
fontSize: '1.25rem',
fontWeight: 700,
color: '#eb1660',
marginLeft: '12px'
}}>
{product.price}
</span>
</div>
<p style={{
margin: 0,
fontSize: '0.875rem',
lineHeight: 1.5,
color: '#6b7280'
}}>
{product.description}
</p>
<button style={{
marginTop: '8px',
padding: '10px 20px',
backgroundColor: '#eb1660',
color: 'white',
border: 'none',
borderRadius: '6px',
fontSize: '0.875rem',
fontWeight: 600,
cursor: 'pointer',
transition: 'background-color 0.2s'
}}
onMouseEnter={(e) => {
e.currentTarget.style.backgroundColor = '#d01454';
}}
onMouseLeave={(e) => {
e.currentTarget.style.backgroundColor = '#eb1660';
}}>
Add to Cart
</button>
</Column>
</Padding>
</Column>
</Container>
</SizedBox>
))}
</div>
</div>
);
};
export default ProductGrid;