import type { Ref, RefAttributes, ReactNode } from "react";
import classNames from "classnames/dedupe";

export interface BodyProps extends RefAttributes<HTMLTableSectionElement> {
  children?: ReactNode;
  className?: string;
}

export type BodyRef = Ref<HTMLTableSectionElement>;

const Body = ({ ref, ...props }: BodyProps) => {
  const classes = classNames("mobius", "mobius-table__body", props.className);

  return <tbody ref={ref} {...props} className={classes} />;
};

Body.displayName = "Table.Body";
export { Body };
