import "./style.pcss";

import type { FC, ReactElement } from "react";
import type { IContainer } from "./config/types";
import type { IComponentBaseProps } from "../../types/components/index";
import { useCN } from "../../utils/react/useCN";

/**
 * Компонент контейнера

 * @returns {ReactElement}
 */
const Container: FC<IContainer & IComponentBaseProps> = ({
  baseClass = "container",
  children = null,
  extraClasses = {},
  extraAttrs = {},
  style = {},
}): ReactElement => {

  const { getCN } = useCN(baseClass);

  return (
    <div style={style} className={getCN("", extraClasses)} {...extraAttrs}>
      {children}
    </div>
  );

};

export type { IContainer };
export { Container };
