From 2056629a0478036a5a05cfb7ea2809306cb3f164 Mon Sep 17 00:00:00 2001 From: Nuwan Date: Tue, 27 Jan 2026 14:05:06 +0530 Subject: [PATCH] feat(08-02): create loading and empty state components Create two stateless components for chat UI states: 1. JKChatLoadingSpinner: - Displays spinner from reactstrap - Shows "Loading messages..." text - Used when fetchStatus is 'loading' 2. JKChatEmptyState: - Shows chat icon and encouraging message - Used when message list is empty - Centered layout with friendly copy Both components are simple, stateless, and require no props. Inline styles used for MVP (SCSS styling deferred to Plan 8.3). Co-Authored-By: Claude Sonnet 4.5 --- .../client/chat/JKChatEmptyState.js | 31 +++++++++++++++++++ .../client/chat/JKChatLoadingSpinner.js | 26 ++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 jam-ui/src/components/client/chat/JKChatEmptyState.js create mode 100644 jam-ui/src/components/client/chat/JKChatLoadingSpinner.js diff --git a/jam-ui/src/components/client/chat/JKChatEmptyState.js b/jam-ui/src/components/client/chat/JKChatEmptyState.js new file mode 100644 index 000000000..8d8894c8d --- /dev/null +++ b/jam-ui/src/components/client/chat/JKChatEmptyState.js @@ -0,0 +1,31 @@ +import React from 'react'; + +/** + * JKChatEmptyState - Empty state component for chat + * + * Displays a friendly message when there are no messages in the channel yet. + * Used when messagesByChannel[channel] is empty. + */ +const JKChatEmptyState = () => { + return ( +
+
💬
+

+ No messages yet +

+

+ Be the first to send a message in this chat! +

+
+ ); +}; + +export default JKChatEmptyState; diff --git a/jam-ui/src/components/client/chat/JKChatLoadingSpinner.js b/jam-ui/src/components/client/chat/JKChatLoadingSpinner.js new file mode 100644 index 000000000..63193b3a3 --- /dev/null +++ b/jam-ui/src/components/client/chat/JKChatLoadingSpinner.js @@ -0,0 +1,26 @@ +import React from 'react'; +import { Spinner } from 'reactstrap'; + +/** + * JKChatLoadingSpinner - Loading state component for chat + * + * Displays a spinner with "Loading messages..." text while fetching chat history. + * Used when fetchStatus is 'loading'. + */ +const JKChatLoadingSpinner = () => { + return ( +
+ +

Loading messages...

+
+ ); +}; + +export default JKChatLoadingSpinner;