import React from "react";
import style from "../../../style";
import { twMerge } from "tailwind-merge";

export interface TableRowProps
  extends React.DetailedHTMLProps<
    React.TdHTMLAttributes<HTMLTableRowElement>,
    HTMLTableRowElement
  > {
  children?: React.ReactNode;
  className?: string;
}

const TableRow = (props: TableRowProps) => {
  const { children, className } = props;

  const attributes = Object.assign({}, props);

  const initialCss = style.table.row;
  const classesMerged = `${initialCss} ${className ? className : ""}`;

  return (
    <tr {...attributes} className={twMerge(classesMerged)}>
      {children}
    </tr>
  );
};

TableRow.displayName = "TableRow";

export default TableRow;
