-
-
Save Ateevduggal/644a39ecc9cec2a9c3e9ebba828c6c5e 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
{ | |
currentData | |
.filter((val) => { | |
if (search === "") { | |
return val; | |
} else if (val.userName.toLowerCase().includes(search.toLowerCase())) { | |
return val; | |
} | |
}) | |
.map((data) => { | |
return ( | |
<> | |
{toggle === data ? ( | |
<EditRow | |
key={data.id} | |
tableData={tableData} | |
setTableData={setTableData} | |
Cancel={Cancel} | |
setEditData={setEditData} | |
editData={editData} | |
/> | |
) : ( | |
<ReadOnly key={data.id} data={data} Edit={Edit} Delete={Delete} /> | |
)} | |
</> | |
); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment