import clsx from 'clsx';
import Heading from '@theme/Heading';
import styles from './styles.module.css';

import guestsFeatureImage from '@site/static/img/guests.png';
import expensesFeatureImage from '@site/static/img/expenses.png';
import seatingFeatureImage from '@site/static/img/tables.png';

type FeatureItem = {
  title: string;
  imagePath: string;
  description: JSX.Element;
};

const FeatureList: FeatureItem[] = [

  {
    title: 'Guests management',
    imagePath: guestsFeatureImage,
    description: (
      <>
        Manage your guests' list, their RSVP status, as well as their dietary preferences and transportation needs.
      </>
    ),
  },
  {
    title: 'Expenses control',
    imagePath: expensesFeatureImage,
    description: (
      <>
        Configure your fixed and per-guest expenses, keeping control of the maximum and projected cost of the wedding (based on your guests' RSVP).
      </>
    ),
  },
  {
    title: 'Seating plan',
    imagePath: seatingFeatureImage,
    description: (
      <>
        Organize your guests into groups and subgroups, and let advanced algorithms suggest different seating arrangements based on the affinity between groups.
      </>
    ),
  },
];

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

export default 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>
    </>
  );
}
