added new props, for triggering for open modal

This commit is contained in:
Pramod Mahajan 2025-05-18 02:16:58 +05:30
parent 09b1664ac7
commit 3e1f93d4f1

View File

@ -23,7 +23,7 @@ const getPhoneIcon = (type) => {
} }
}; };
const ListViewDirectory = ({ contact }) => { const ListViewDirectory = ({ contact,setSelectedContact,setIsOpenModal }) => {
return ( return (
<tr key={contact.id} > <tr key={contact.id} >
<td className="text-start" colSpan={2}>{`${contact.name}`}</td> <td className="text-start" colSpan={2}>{`${contact.name}`}</td>
@ -40,7 +40,6 @@ const ListViewDirectory = ({ contact }) => {
</div> </div>
</td> </td>
{/* Phones */}
<td> <td>
<div className="d-flex flex-column align-items-start"> <div className="d-flex flex-column align-items-start">
{contact.contactPhones?.map((phone, index) => ( {contact.contactPhones?.map((phone, index) => (
@ -64,7 +63,11 @@ const ListViewDirectory = ({ contact }) => {
{/* Actions */} {/* Actions */}
<td className="align-middle text-center "> <td className="align-middle text-center ">
<i className='bx bx-edit bx-sm text-primary cursor-pointer'></i> <i className='bx bx-edit bx-sm text-primary cursor-pointer' onClick={() =>
{
setSelectedContact( contact )
setIsOpenModal(true)
}}></i>
<i className='bx bx-trash bx-sm text-danger cursor-pointer'></i> <i className='bx bx-trash bx-sm text-danger cursor-pointer'></i>
</td> </td>
</tr> </tr>