import React from "react";
import style from "./section.container.module.css";
import classNames from "classnames";

export type SectionContainerBorders = "rounded" | "none";

interface CardProps {
    children: React.ReactNode;
    borders?: SectionContainerBorders;
    style?: React.CSSProperties;
}

export default function Card(props: CardProps): React.ReactElement {
    const { borders = "rounded" } = props;

    const getClassNames = () => {
        const base = style.sectionContainer;
        if (borders === "rounded") {
            return classNames(base, style.sectionContainerRounded);
        } else if (borders === "none") {
            return classNames(base);
        }
        return base;
    };

    return (
        <div className={getClassNames()} style={props.style}>
            {props.children}
        </div>
    );
}
