From 3d9b4e4eb349d665d48f41070dfedda8cb39f041 Mon Sep 17 00:00:00 2001 From: Dries Augustyns Date: Tue, 21 Apr 2026 10:22:05 +0200 Subject: [PATCH] ui: Update empty states --- .../src/components/CampaignSelectionDialog.tsx | 13 ++++++------- .../src/components/DataManagementSettings.tsx | 15 ++++++++++++--- apps/web/src/components/DomainsSettings.tsx | 11 +++++++---- .../src/components/TemplateSelectionDialog.tsx | 13 ++++++------- apps/web/src/pages/analytics/index.tsx | 16 ++++++++++------ 5 files changed, 41 insertions(+), 27 deletions(-) diff --git a/apps/web/src/components/CampaignSelectionDialog.tsx b/apps/web/src/components/CampaignSelectionDialog.tsx index 641cb56..cee37a7 100644 --- a/apps/web/src/components/CampaignSelectionDialog.tsx +++ b/apps/web/src/components/CampaignSelectionDialog.tsx @@ -25,6 +25,7 @@ import type {PaginatedResponse} from '@plunk/types'; import {ArrowLeft, Calendar, Mail, Users} from 'lucide-react'; import {useState} from 'react'; import useSWR from 'swr'; +import {EmptyState} from './EmptyState'; interface CampaignSelectionDialogProps { open: boolean; @@ -186,13 +187,11 @@ export function CampaignSelectionDialog({open, onOpenChange, onSelectCampaign}: )} {!isLoading && data?.data.length === 0 && ( -
- -

No campaigns found

-

- {statusFilter !== 'ALL' ? 'Try adjusting your filter' : 'Create your first campaign to get started'} -

-
+ )} {data?.data.map(campaign => ( diff --git a/apps/web/src/components/DataManagementSettings.tsx b/apps/web/src/components/DataManagementSettings.tsx index e6f2f52..b087c32 100644 --- a/apps/web/src/components/DataManagementSettings.tsx +++ b/apps/web/src/components/DataManagementSettings.tsx @@ -21,7 +21,8 @@ import { TableHeader, TableRow, } from '@plunk/ui'; -import {AlertCircle, Loader2, Trash2} from 'lucide-react'; +import {AlertCircle, Database, Loader2, Trash2, Zap} from 'lucide-react'; +import {EmptyState} from './EmptyState'; import {toast} from 'sonner'; import useSWR from 'swr'; import {useActiveProject} from '../lib/contexts/ActiveProjectProvider'; @@ -151,7 +152,11 @@ export function DataManagementSettings() { {customFields.length === 0 ? ( -

No custom fields found

+ ) : ( @@ -196,7 +201,11 @@ export function DataManagementSettings() { {customEvents.length === 0 ? ( -

No custom events found

+ ) : (
diff --git a/apps/web/src/components/DomainsSettings.tsx b/apps/web/src/components/DomainsSettings.tsx index 0771623..f299bfa 100644 --- a/apps/web/src/components/DomainsSettings.tsx +++ b/apps/web/src/components/DomainsSettings.tsx @@ -20,7 +20,8 @@ import { Input, } from '@plunk/ui'; import {AnimatePresence, motion} from 'framer-motion'; -import {Check, CheckCircle2, ChevronDown, Copy, Loader2, RefreshCw, Trash2, XCircle} from 'lucide-react'; +import {Check, CheckCircle2, ChevronDown, Copy, Globe, Loader2, RefreshCw, Trash2, XCircle} from 'lucide-react'; +import {EmptyState} from './EmptyState'; import {useConfig} from '../lib/hooks/useConfig'; import {useAddDomain, useCheckDomainVerification, useDomains, useRemoveDomain} from '../lib/hooks/useDomains'; @@ -324,9 +325,11 @@ export function DomainsSettings({projectId}: DomainsSettingsProps) { ) : !domains || domains.length === 0 ? ( -
-

No domains added yet

-
+ ) : (
{domains.map(domain => { diff --git a/apps/web/src/components/TemplateSelectionDialog.tsx b/apps/web/src/components/TemplateSelectionDialog.tsx index 08f9ae9..f104245 100644 --- a/apps/web/src/components/TemplateSelectionDialog.tsx +++ b/apps/web/src/components/TemplateSelectionDialog.tsx @@ -20,6 +20,7 @@ import type {PaginatedResponse} from '@plunk/types'; import {ArrowLeft, FileText, Search} from 'lucide-react'; import {useState} from 'react'; import useSWR from 'swr'; +import {EmptyState} from './EmptyState'; interface TemplateSelectionDialogProps { open: boolean; @@ -224,13 +225,11 @@ export function TemplateSelectionDialog({open, onOpenChange, onSelectTemplate}: )} {!isLoading && data?.data.length === 0 && ( -
- -

No templates found

-

- {search ? 'Try adjusting your search terms' : 'Create a template first to use this feature'} -

-
+ )} {data?.data.map(template => ( diff --git a/apps/web/src/pages/analytics/index.tsx b/apps/web/src/pages/analytics/index.tsx index 1d4d5b1..132f4dc 100644 --- a/apps/web/src/pages/analytics/index.tsx +++ b/apps/web/src/pages/analytics/index.tsx @@ -271,9 +271,11 @@ export default function AnalyticsPage() { {!hasData ? (
- -

No email data yet

-

Send your first email to see analytics here.

+
+ +
+

No email data yet

+

Send your first email to see analytics here.

) : ( @@ -380,9 +382,11 @@ export default function AnalyticsPage() { {!hasData ? (
- -

No engagement data

-

+

+ +
+

No engagement data

+

Engagement metrics will appear once emails are opened.