'use client';

import { useTranslator } from '@/contexts/TranslatorContext';
import React from 'react';
import {
  Archive,
  ShieldAlert,
  Lock,
  ScanSearch,
  Mail,
  CloudCog,
  LayoutDashboard,
  Settings,
} from 'lucide-react';

const featureKeysWithIcons = [
  { key: 'cloudHosting.features.f1', Icon: LayoutDashboard },
  { key: 'cloudHosting.features.f2', Icon: Settings },
  { key: 'cloudHosting.features.f3', Icon: ScanSearch },
  { key: 'cloudHosting.features.f4', Icon: Mail },
  { key: 'cloudHosting.features.f5', Icon: Lock },
  { key: 'cloudHosting.features.f6', Icon: Archive },
  { key: 'cloudHosting.features.f7', Icon: CloudCog },
  { key: 'cloudHosting.features.f8', Icon: ShieldAlert },
];

const FeaturesSection = () => {
  const { translations } = useTranslator();

  return (
    <section className='my-12'>
      <div className='flex justify-center mt-[60px]'>
        <div className='grid lg:grid-cols-3 md:grid-cols-2 grid-cols-1 gap-6'>
          {featureKeysWithIcons.map((item, index) => {
            const IconComponent = item.Icon;
            return (
              <div
                key={index}
                className='flex flex-row items-center gap-2 w-80'>
                <span className='w-6 h-6 flex-shrink-0 flex items-center justify-center text-[#092346]'>
                  <IconComponent className='w-6 h-6' strokeWidth={1.8} />
                </span>
                <p className='text-gray-800 text-right'>
                  {translations[item.key] || item.key}
                </p>
              </div>
            );
          })}
        </div>
      </div>
    </section>
  );
};

export default FeaturesSection;
