Skip to content

Commit

Permalink
fixed the edit button
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan-Roberts123 committed Apr 29, 2024
1 parent 872c9fb commit 44dc541
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions components/Client.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import PropTypes from 'prop-types'
import Link from 'next/link'
import { FaRegEdit } from 'react-icons/fa'
import { useRouter } from 'next/navigation'

const Client = ({ id, name, email, phone, address, company, notes }) => {
const router = useRouter()
return (
<>
<tr>
Expand All @@ -17,11 +19,12 @@ const Client = ({ id, name, email, phone, address, company, notes }) => {
<td className="border px-4 py-2">
<button
name={`edit ${name}`}
onClick={() => {
router.push(`/edit/${id}`)
}}
className="bg-orange-500 hover:bg-orange-700 text-white font-bold py-2 px-4 rounded"
>
<Link href="/edit/[id]" as={`/edit/${id}`}>
<FaRegEdit />
</Link>
<FaRegEdit />
</button>
</td>
</tr>
Expand Down

0 comments on commit 44dc541

Please sign in to comment.