import React from "react";
import classNames from "classnames";
import { bem } from "../../utilities/bem";

const cn = "TableRow";

export interface TableRowProps extends React.HTMLProps<HTMLTableRowElement> {
  selected?: boolean;
}

const TableRow = ({
  className,
  children,
  selected,
  ...rest
}: TableRowProps) => {
  return (
    <tr
      className={classNames(
        bem(cn),
        selected && bem(cn, { m: "selected" }),
        className,
      )}
      {...rest}
    >
      {children}
    </tr>
  );
};

export default TableRow;
