import React from 'react';
import clsx from 'clsx';
import styles from './styles.module.css';

type FeatureItem = {
  title: string;
  Svg: React.ComponentType<React.ComponentProps<'svg'>>;
  description: JSX.Element;
};

const FeatureList: FeatureItem[] = [
  {
    title: 'Event Driven Architecture',
    Svg: require('@site/static/img/kafka_producers_consumers.svg').default,
    description: (
      <>
        Enable autonomous, reactive and adaptable microservices through events.<br></br>
        Delve into our EDA docs to start breaking down monoliths!
      </>
    ),
  },
  {
    title: 'Change Data Capture',
    Svg: require('@site/static/img/databases.svg').default,
    description: (
      <>
        Synchronise data across databases following our CDC documentation.
      </>
    ),
  },
  {
    title: 'Tooling',
    Svg: require('@site/static/img/toolbox.svg').default,
    description: (
      <>
        Explore our available tools and docs to work with Kafka based solutions.
      </>
    ),
  },
];

function Feature({title, Svg, description}: FeatureItem) {
  return (
    <div className={clsx('col col--4')}>
      <div className="text--center">
        <Svg className={styles.featureSvg} role="img" />
      </div>
      <div className="text--center padding-horiz--md">
        <h3>{title}</h3>
        <p>{description}</p>
      </div>
    </div>
  );
}

function HomepageFeatures(): JSX.Element {
  return (
    <section className={styles.features}>
      <div className="container">
        <div className="row">
          {FeatureList.map((props, idx) => (
            <Feature key={idx} {...props} />
          ))}
        </div>
      </div>
    </section>
  );
}

export default HomepageFeatures;