---
import type { HTMLAttributes } from "astro/types";
import { cva, type VariantProps } from "class-variance-authority";

const section = cva("relative w-full", {
  variants: {
    padding: {
      true: "px-section-main-x py-section-main-y",
      false: "p-0",
    },
    maxWidth: {
      true: "max-w-max-section mx-auto",
      false: "",
    },
  },
});

export interface Props
  extends HTMLAttributes<"section">,
    VariantProps<typeof section> {}

const { padding = true, maxWidth = true, ...props } = Astro.props;
---

<section {...props} class={section({ padding, maxWidth })}>
  <slot />
</section>
