From b7d7a852538c70dcb532561f814749c4f391162f Mon Sep 17 00:00:00 2001
From: byGalax
Date: Sat, 16 May 2026 16:51:37 +0200
Subject: [PATCH] feat(desktop): empty-state for chat list
Co-Authored-By: Claude Opus 4.7 (1M context)
---
apps/desktop/src/pages/ChatsPage.tsx | 46 +++++++++++++++-------------
1 file changed, 24 insertions(+), 22 deletions(-)
diff --git a/apps/desktop/src/pages/ChatsPage.tsx b/apps/desktop/src/pages/ChatsPage.tsx
index 8f00d0b..6ee0f89 100644
--- a/apps/desktop/src/pages/ChatsPage.tsx
+++ b/apps/desktop/src/pages/ChatsPage.tsx
@@ -2,10 +2,11 @@ import { acceptDm, type ConversationSummary, isConversationMuted } from '@chat-a
import { extractErrorCode } from '@chat-app/shared/i18n';
import { useEffect, useMemo, useRef, useState } from 'react';
import { useTranslation } from 'react-i18next';
-import { NavLink, Outlet, useParams } from 'react-router-dom';
+import { NavLink, Outlet, useNavigate, useParams } from 'react-router-dom';
import { ConversationRowMenu } from '../components/ConversationRowMenu';
import { CreateGroupDialog } from '../components/CreateGroupDialog';
+import { EmptyState } from '../components/EmptyState';
import {
AddUserIcon,
ArchiveIcon,
@@ -119,6 +120,7 @@ function ConversationList({
archivedCount,
}: ConversationListProps) {
const { t } = useTranslation(['app']);
+ const navigate = useNavigate();
return (
) : items.length === 0 ? (
-
-
- {showArchived ? (
-
- ) : (
-
- )}
-
-
- {showArchived
- ? t('app:chats.archived_empty_title', { defaultValue: 'Nichts archiviert' })
- : t('app:chats.empty_title')}
-
-
- {showArchived
- ? t('app:chats.archived_empty_subtitle', {
- defaultValue: 'Archivierte Unterhaltungen erscheinen hier.',
- })
- : t('app:chats.empty_subtitle')}
-
-
+ showArchived ? (
+ }
+ title={t('app:chats.archived_empty_title', { defaultValue: 'Nichts archiviert' })}
+ description={t('app:chats.archived_empty_subtitle', {
+ defaultValue: 'Archivierte Unterhaltungen erscheinen hier.',
+ })}
+ />
+ ) : (
+ }
+ title={t('app:chats.empty_title', { defaultValue: 'Noch keine Chats' })}
+ description={t('app:chats.empty_desc', {
+ defaultValue: 'Lade einen Freund ein und schreibe die erste Nachricht.',
+ })}
+ action={{
+ label: t('app:chats.empty_cta', { defaultValue: 'Freunde verwalten' }),
+ onClick: () => navigate('/friends'),
+ }}
+ />
+ )
) : (