97 lines
3.2 KiB
TypeScript
97 lines
3.2 KiB
TypeScript
import React, { useState } from 'react';
|
|
import { Box, Container, Grid, Tabs, Tab, Button } from '@mui/material';
|
|
import { ArrowRight } from 'lucide-react';
|
|
import { useNavigate } from 'react-router-dom';
|
|
import { SectionHeading } from '../../common/SectionHeading/SectionHeading';
|
|
import { ProductCard } from '../../common/ProductCard/ProductCard';
|
|
import { PRODUCTS } from '../../../data/productsData';
|
|
|
|
export const ProductsPreview: React.FC = () => {
|
|
const [filter, setFilter] = useState<'all' | 'spices' | 'organic-fertilizers'>('all');
|
|
const navigate = useNavigate();
|
|
|
|
const filteredProducts =
|
|
filter === 'all' ? PRODUCTS : PRODUCTS.filter((p) => p.category === filter);
|
|
|
|
return (
|
|
<Box sx={{ py: { xs: 8, md: 12 }, bgcolor: '#FBF9F5' }}>
|
|
<Container maxWidth="lg">
|
|
<SectionHeading
|
|
badge="Export Portfolio"
|
|
title="Our Premium Agro"
|
|
highlightedWord="Products"
|
|
subtitle="Processed to international standards with rigorous purity, customizable pungency, mesh fineness, and flexible export packaging."
|
|
/>
|
|
|
|
{/* Filter Tabs */}
|
|
<Box sx={{ display: 'flex', justifyContent: 'center', mb: 5 }}>
|
|
<Tabs
|
|
value={filter}
|
|
onChange={(_, val) => setFilter(val)}
|
|
centered
|
|
sx={{
|
|
bgcolor: 'rgba(27, 77, 62, 0.06)',
|
|
p: 0.6,
|
|
borderRadius: 3,
|
|
'& .MuiTabs-indicator': {
|
|
display: 'none',
|
|
},
|
|
'& .MuiTab-root': {
|
|
borderRadius: 2.5,
|
|
fontWeight: 700,
|
|
fontSize: '0.9rem',
|
|
color: '#4A5B53',
|
|
minHeight: 40,
|
|
px: 2.5,
|
|
py: 1,
|
|
transition: 'all 0.2s',
|
|
'&.Mui-selected': {
|
|
bgcolor: '#1B4D3E',
|
|
color: '#FFFFFF',
|
|
boxShadow: '0 4px 12px rgba(27, 77, 62, 0.2)',
|
|
},
|
|
},
|
|
}}
|
|
>
|
|
<Tab value="all" label="All Commodities" />
|
|
<Tab value="spices" label="Ground Spices" />
|
|
<Tab value="organic-fertilizers" label="Organic Bio-Fertilizers" />
|
|
</Tabs>
|
|
</Box>
|
|
|
|
{/* Product Cards Grid */}
|
|
<Grid container spacing={3.5}>
|
|
{filteredProducts.map((product) => (
|
|
<Grid key={product.id} size={{ xs: 12, sm: 6, lg: 6 }}>
|
|
<ProductCard product={product} />
|
|
</Grid>
|
|
))}
|
|
</Grid>
|
|
|
|
{/* View All CTA */}
|
|
<Box sx={{ textAlign: 'center', mt: 6 }}>
|
|
<Button
|
|
variant="outlined"
|
|
size="large"
|
|
endIcon={<ArrowRight size={18} />}
|
|
onClick={() => navigate('/products')}
|
|
sx={{
|
|
borderColor: '#1B4D3E',
|
|
color: '#1B4D3E',
|
|
fontWeight: 700,
|
|
px: 3.5,
|
|
py: 1.3,
|
|
'&:hover': {
|
|
bgcolor: '#1B4D3E',
|
|
color: '#FFFFFF',
|
|
},
|
|
}}
|
|
>
|
|
View Technical Specifications & Packaging Options
|
|
</Button>
|
|
</Box>
|
|
</Container>
|
|
</Box>
|
|
);
|
|
};
|