import React from "react";
import { TableColumn } from "./TableProps";
import { TableColGroup } from "./TableColGroup";
import { StyledProps } from "../_type";

export interface TableBoxProps extends StyledProps {
  columns: TableColumn[];
  children: React.ReactChild;
  classPrefix: string;
}

export function TableBox({
  columns,
  children,
  classPrefix,
  style,
}: TableBoxProps) {
  return (
    <table className={`${classPrefix}-table__box`} style={style}>
      <TableColGroup columns={columns} />
      {children}
    </table>
  );
}

TableBox.displayName = "TableBox";
