app/javascript/components/data-tables/button-list/index.jsx
import React from 'react';
import { tableData } from './helper';
import MiqDataTable from '../../miq-data-table';
const ButtonList = (props) => {
const { headers, rows } = tableData(props);
/** Function to execute the row's click event */
const onSelect = (selectedRow) => {
const selected = rows.find((row) => row.id === selectedRow.id);
miqTreeActivateNode(selected.treeBox, selected.nodeKey);
};
return (
<MiqDataTable
headers={headers}
rows={rows}
onCellClick={(selectedRow) => onSelect(selectedRow)}
mode="button-list"
/>
);
};
export default ButtonList;