improve TableRow component

This commit is contained in:
João Geonizeli
2021-09-06 11:42:50 -03:00
parent 095495ac50
commit 1c4cbb4522

View File

@@ -1,3 +1,4 @@
import classNames from "classnames";
import type { FC, ReactNode } from "react";
import React from "react";
@@ -15,12 +16,16 @@ export const TableRow: FC<Props> = ({ items, id, onClick }) => {
};
return (
<tr onClick={handleClick}>
{items?.map((item, index) => (
<td
key={index}
className="px-5 py-5 border-b border-gray-200 bg-white text-sm"
<tr
onClick={handleClick}
className={classNames(
"bg-white",
onClick &&
"bg-white hover:bg-gray-100 cursor-pointer transition duration-500"
)}
>
{items?.map((item, index) => (
<td key={index} className="px-5 py-5 border-b border-gray-200 text-sm">
<p className="text-gray-900 whitespace-nowrap">{item}</p>
</td>
))}