display not found msg if data is empty

This commit is contained in:
Pramod Mahajan 2025-05-22 18:20:34 +05:30
parent 10e38353aa
commit ab47a44c60

View File

@ -83,27 +83,19 @@ const NotesDirectory = ({ isLoading, contactProfile, setProfileContact }) => {
return ( return (
<div className="text-start"> <div className="text-start">
<div <div className="d-flex align-items-center justify-content-between">
className={`${ <p className="fw-semibold m-0">Notes :</p>
contactProfile?.notes?.length > 0 <span
? "d-flex justify-content-between" className={`btn btn-xs ${addNote ? "btn-danger" : "btn-primary"}`}
: "d-flex justify-content-end" onClick={() => setAddNote( !addNote )}
}`}
>
{contactProfile?.notes.length > 0 && (
<p className="fw-semibold m-0">Notes :</p>
)}
<a
className="small-text m-0 cursor-pointer"
onClick={() => setAddNote(!addNote)}
> >
<u> {/* <i
{addNote ? "" : "Add Note"} className={`icon-base bx ${
<i addNote ? "bx-x bx-sm" : "bx-pencil"
className={`bx ${addNote ? "bx-x" : "bx-pencil"} bx-xs`} } bx-xs `}
></i>{" "} ></i> */}
</u>{" "} {addNote ? "close" : "Add Note"}
</a> </span>
</div> </div>
{addNote && ( {addNote && (
<form onSubmit={handleSubmit(onSubmit)}> <form onSubmit={handleSubmit(onSubmit)}>
@ -119,10 +111,7 @@ const NotesDirectory = ({ isLoading, contactProfile, setProfileContact }) => {
)} )}
</form> </form>
)} )}
<div <div className=" justify-content-start px-1 mt-1">
className=" justify-content-start overflow-auto px-1"
style={{ maxHeight: "300px" }}
>
{isLoading && ( {isLoading && (
<div className="text-center"> <div className="text-center">
{" "} {" "}
@ -139,7 +128,8 @@ const NotesDirectory = ({ isLoading, contactProfile, setProfileContact }) => {
setProfileContact={setProfileContact} setProfileContact={setProfileContact}
key={noteItem.id} key={noteItem.id}
/> />
))} ) )}
<p>{!isLoading && contactProfile?.notes.length == 0 && !addNote && (<p className="text-center">No Notes Found</p>) }</p>
</div> </div>
</div> </div>
); );