Skip to content

Commit f180b4a

Browse files
committed
:chore: Update empty state when no valid emails are found
1 parent 62051b6 commit f180b4a

File tree

2 files changed

+48
-11
lines changed

2 files changed

+48
-11
lines changed
Lines changed: 21 additions & 0 deletions
Loading

src/app/[id]/SelectEmails.tsx

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -233,9 +233,17 @@ const SelectEmails = ({ id }: { id: string }) => {
233233

234234
if (fetchedEmails.filter((email) => email.valid).length === 0) {
235235
return (
236-
<div className="rounded-lg border border-grey-200 p-4 text-grey-700">
237-
No valid emails found. Please check your inbox
238-
</div>
236+
<Image
237+
src="/assets/noEmailIllustration.svg"
238+
alt="no valid emails found"
239+
width={316}
240+
height={316}
241+
style={{
242+
margin: 'auto',
243+
maxWidth: '100%',
244+
height: 'auto',
245+
}}
246+
/>
239247
);
240248
}
241249

@@ -460,14 +468,22 @@ const SelectEmails = ({ id }: { id: string }) => {
460468
<div className="flex flex-col items-center justify-center gap-6">
461469
<div className="flex w-full flex-col gap-1">
462470
<h4 className="text-xl font-bold text-grey-800">Select Emails</h4>
463-
<p className="text-base font-medium text-grey-700">
464-
Choose the emails you want to create proofs for.
465-
</p>
466-
<p className="text-base font-medium text-grey-700">
467-
<span className="font-bold text-grey-900">Note</span> - If you select to create the proofs
468-
remotely, your emails will be sent to our secured service for proof generation. Emails
469-
will be deleted once the proofs are generated
470-
</p>
471+
{fetchedEmails.filter((email) => email.valid).length === 0 && !isFetchEmailLoading ? (
472+
<p className="text-base font-medium text-grey-700">
473+
No matching emails were found in your inbox
474+
</p>
475+
) : (
476+
<>
477+
<p className="text-base font-medium text-grey-700">
478+
Choose the emails you want to create proofs for.
479+
</p>
480+
<p className="text-base font-medium text-grey-700">
481+
<span className="font-bold text-grey-900">Note</span> - If you select to create the
482+
proofs remotely, your emails will be sent to our secured service for proof generation.
483+
Emails will be deleted once the proofs are generated
484+
</p>
485+
</>
486+
)}
471487
</div>
472488

473489
{renderEmailsTable()}

0 commit comments

Comments
 (0)