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

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

export type HeadRef = Ref<HTMLTableSectionElement>;

const Head = ({ ref, ...props }: HeadProps) => {
  const classes = classNames("mobius", "mobius-table__head", props.className);

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

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