import React from "react"; const Table = ({ columns = [], data = [], actions }) => { return (
{" "} {/* <-- text-center added */} {columns.map((col) => ( ))} {actions && } {data.map((row, index) => ( {columns.map((col) => ( ))} {actions && ( )} ))}
{col.label} Action
{col.render ? col.render(row[col.key], row, index) // pass index here : row[col.key]} {actions(row)}
); }; export default Table;