/**
 * Copyright 2024 Phenix Real Time Solutions, Inc. Confidential and Proprietary. All Rights Reserved.
 */
import React from 'react';
import TableRow from './table-row';
import {Tbody} from './style';
import {ColumnsType} from './props';

interface ITableBody {
  columns: ColumnsType;
  data: Record<string, string | number | null>[];
}

export const TableBody = ({columns, data}: ITableBody): React.JSX.Element => (
  <Tbody>{data.length ? data.map((row, idx) => <TableRow key={`tableRow-${idx}-${Date.now()}`} columns={columns} row={row} />) : null}</Tbody>
);

export default TableBody;
