import { cva, type VariantProps } from "class-variance-authority";
import type { HTMLAttributes } from "react";
import { cn } from "@/lib/utils";

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: "",
		},
	},
	defaultVariants: {
		padding: true,
		maxWidth: true,
	},
});

type Props = HTMLAttributes<HTMLElement> & VariantProps<typeof section>;

export default function Section({
	padding,
	maxWidth,
	className,
	...props
}: Props) {
	return (
		<section
			{...props}
			className={cn(section({ padding, maxWidth }), className)}
		/>
	);
}
