У меня есть массив с именем 'data', и я хочу сопоставить значок шрифта с ... А остальные значения получаются путем сопоставления объекта массива.
Ниже приведены мои code.
import React, { Component } from "react";
import { connect } from "react-redux";
import { withRouter } from "react-router-dom";
import { bindActionCreators } from "redux";
import { Link, Prompt } from "react-router-dom";
import {
Field,
reduxForm,
getFormValues,
FieldArray,
isDirty,
change
} from "redux-form";
import { InputField } from "../../components/controls/Fields";
import TabbedModal from "../../components/tabbedModal/TabbedModal";
import "../userSubscribers/userSubscribers.scss";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faSearch } from "@fortawesome/free-solid-svg-icons";
let data = [
{
col1: "123123",
col2: "test_name",
col3: "test_name",
col4: "1234567890",
col5: "6425625521",
col6: "5463567578",
col7: "test_type",
col8: "active",
col9: "test_package",
col10: "View Content"
}
];
render() {
<label>Connection Details</label>
<table id="mytable" className="table">
<thead className="components">
<th className="table-header-font">Connection ID</th>
<th className="table-header-font">Username</th>
<th className="table-header-font">Name</th>
<th className="table-header-font">SLT Acc No</th>
<th className="table-header-font">SLT Tel No</th>
<th className="table-header-font">Mobile No</th>
<th className="table-header-font">Connection Type</th>
<th className="table-header-font">Status</th>
<th className="table-header-font">PEOTV GO Base Package</th>
<th className="table-header-font"></th>
</thead>
<tbody className="components">
{/* <tbody styles={"width: 100px; overflow: auto;display:block;"}> */}
{data.map((row, i) => {
return (
<tr key={i}>
{Object.entries(row).map(([key, value]) => {
return (
<td className="table-data" key={key}>
{value}
</td>
);
})}
</tr>
);
})}
</tbody>
</table>
</div>
);
}
}
Во время сопоставления должен появиться значок fontawesome в последнем вместе с текстом в последнем столбце. Как это сделать? Пожалуйста, помогите мне разобраться с этим.