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

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

export type FootRef = Ref<HTMLTableSectionElement>;

const Foot = ({ ref, ...props }: FootProps) => {
  const classes = classNames("mobius", "mobius-table__foot", props.className);

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

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