import React from "react";
import type { Content, Data } from "../Components";
import { generateReactElements } from "../index";

type Props = {
  readonly className: string;
  readonly content: Content[];
  readonly children: Data[];
};

export const Section = ({ className, content, children }: Props) => {
  return (
    <section className={className}>
      {children.map((child, index) => (
        <React.Fragment key={index}>{generateReactElements(child, content)}</React.Fragment>
      ))}
    </section>
  );
};
