Skip to content

Instantly share code, notes, and snippets.

@Ateevduggal
Created Jun 11, 2022
Embed
What would you like to do?
import React from "react";
const EditRow = ({
tableData,
Cancel,
setTableData,
editData,
setEditData,
}) => {
return (
<>
<tr>
<td>
<input
type="text"
name="fullName"
required
placeholder="Enter a name..."
onChange={handleEditChange}
value={editData.fullName}
/>
</td>
<td>
<input
type="text"
name="userName"
required
placeholder="Enter user name..."
onChange={handleEditChange}
value={editData.userName}
/>
</td>
<td>
<input
type="text"
name="phoneNumber"
required
placeholder="Enter a phone number..."
onChange={handleEditChange}
value={editData.phoneNumber}
/>
</td>
<td>
<input
type="text"
name="website"
required
placeholder="Enter website..."
onChange={handleEditChange}
value={editData.website}
/>
</td>
<td>
<input
type="text"
name="companyName"
required
placeholder="Enter company name..."
onChange={handleEditChange}
value={editData.companyName}
/>
</td>
<td>
<input
type="email"
name="email"
required
placeholder="Enter an email..."
onChange={handleEditChange}
value={editData.email}
/>
</td>
<td className="d-flex justify-content-center">
<button className="btn btn-success" type="submit" onClick={Save}>
<i class="fa-solid fa-floppy-disk"></i>
</button>
<button className="btn btn-danger" type="button" onClick={Cancel}>
<i class="fa-solid fa-ban"></i>
</button>
</td>
</tr>
</>
);
};
export default EditRow;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment