import React, { useState } from 'react' import { Row as RowProps } from '@tanstack/react-table' import Cell from './Cell' type Props = { // eslint-disable-next-line @typescript-eslint/no-explicit-any row: RowProps isSelected: boolean bottomElement?: React.MutableRefObject onExpandButtonClick: () => void } export const Row = ({ row, bottomElement, onExpandButtonClick }: Props) => { const [isExpandButtonVisible, setIsExpandButtonVisible] = useState(false) const showExpandButton = () => setIsExpandButtonVisible(true) const hideExpandButton = () => setIsExpandButtonVisible(false) return ( { if (bottomElement && bottomElement.current?.dataset.rowid !== row.id) bottomElement.current = ref }} onMouseEnter={showExpandButton} onClick={showExpandButton} onMouseLeave={hideExpandButton} > {row.getVisibleCells().map((cell, cellIndex) => ( ))} ) }