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

export interface RowProps extends RefAttributes<HTMLTableRowElement> {
  children?: ReactNode;
  className?: string;
}

export type RowRef = Ref<HTMLTableRowElement>;

const Row = ({ ref, ...props }: RowProps) => {
  const classes = classNames("mobius", "mobius-table__row", props.className);

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

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