import React from 'react';
import { Box, Typography } from '@mui/material';
import AssignmentTurnedInIcon from '@mui/icons-material/AssignmentTurnedIn';
import ReplayIcon from '@mui/icons-material/Replay';
import AssuredWorkloadIcon from '@mui/icons-material/AssuredWorkload';
import SupportAgentIcon from '@mui/icons-material/SupportAgent';

const Feature = () => {
  const features = [
    { icon: <AssignmentTurnedInIcon color="primary" sx={{ fontSize: 40 }} />, name: 'Pickup at any Store', description: "Free shipping on orders over $65" },
    { icon: <ReplayIcon color="primary" sx={{ fontSize: 40 }} />, name: 'Free returns', description:"30-days free return policy." },
    { icon: <AssuredWorkloadIcon color="primary" sx={{ fontSize: 40 }} />, name: 'Secured payments', description:"We accept all major credit cards."  },
    { icon: <SupportAgentIcon color="primary" sx={{ fontSize: 40 }} />, name: 'Customer service', description:"Top notch customer service." },
  ];

  return (
    <Box
      sx={{
        display: 'flex',
        justifyContent: 'space-between',
        alignItems: 'center',
        padding: 2,
        mt:5
      }}
    >
      {features.map((feature, index) => (
        <Box
          key={index}
          sx={{
            display: 'flex',
            flexDirection: 'column',
            alignItems: 'center',
            textAlign: 'center',
            flex: 1,
            borderRight: index < features.length - 1 ? '1px solid #CFCFCF' : 'none', // Add right border except for the last item
            padding: 2,
          }}
        >
          {feature.icon}
          <Typography
            variant="body1"
            sx={{ marginTop: 1, fontWeight: 'bold', color: 'text.primary' }}
          >
            {feature.name}
          </Typography>
          <Typography
            variant="body2"
            sx={{ marginTop: 1, color: 'text.primary' }}
          >
            {feature.description}
          </Typography>
        </Box>
      ))}
    </Box>
  );
};

export default Feature;
