-
-
Save Ateevduggal/3a7a211f19eb7b75a7d7be18d937ee2b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState } from "react"; | |
import { data } from "./Data"; | |
export const App = () => { | |
return ( | |
<> | |
<div className="container-fluid"> | |
<div className="row pt-5"> | |
<form> | |
<table className="table table-striped table-primary table-hover text-center fs-5 table-bordered border-dark"> | |
<thead> | |
<tr> | |
<th id="tr" onClick={() => Sort("fullName")}> | |
Name | |
</th> | |
<th id="tr" onClick={() => Sort("userName")}> | |
User Name | |
</th> | |
<th id="tr" onClick={() => Sort("phoneNumber")}> | |
Phone Number | |
</th> | |
<th id="tr" onClick={() => Sort("website")}> | |
Website | |
</th> | |
<th id="tr" onClick={() => Sort("companyName")}> | |
Company Name | |
</th> | |
<th id="tr" onClick={() => Sort("email")}> | |
</th> | |
<th id="tr">Action</th> | |
</tr> | |
</thead> | |
<tbody> | |
{data.map((data) => { | |
return ( | |
<> | |
<tr> | |
<td>{data.fullName}</td> | |
<td>{data.userName}</td> | |
<td>{data.phoneNumber}</td> | |
<td>{data.website}</td> | |
<td>{data.companyName}</td> | |
<td>{data.email}</td> | |
<td className="d-flex p-4"> | |
<button className="btn btn-dark me-3"> | |
<i class="fa-solid fa-pen-to-square"></i> | |
</button> | |
<button className="btn btn-danger"> | |
<i class="fa-solid fa-trash"></i> | |
</button> | |
</td> | |
</tr> | |
</> | |
); | |
})} | |
</tbody> | |
</table> | |
</form> | |
</div> | |
</div> | |
</> | |
); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment