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 type { FC, ReactNode } from "react";
import React from "react"; import React from "react";
@@ -15,12 +16,16 @@ export const TableRow: FC<Props> = ({ items, id, onClick }) => {
}; };
return ( return (
<tr onClick={handleClick}> <tr
{items?.map((item, index) => ( onClick={handleClick}
<td className={classNames(
key={index} "bg-white",
className="px-5 py-5 border-b border-gray-200 bg-white text-sm" 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> <p className="text-gray-900 whitespace-nowrap">{item}</p>
</td> </td>
))} ))}