MCPcopy Create free account
hub / github.com/sqlchat/sqlchat / EmptyView

Function EmptyView

src/components/EmptyView.tsx:13–75  ·  view source on GitHub ↗
(props: Props)

Source from the content-addressed store, hash-verified

11}
12
13const EmptyView = (props: Props) => {
14 const { className, sendMessage } = props;
15 const connectionStore = useConnectionStore();
16 const conversationStore = useConversationStore();
17 const messageStore = useMessageStore();
18 const isDarkMode = useDarkMode();
19
20 const handleExampleClick = async (content: string) => {
21 let conversation = conversationStore.getConversationById(conversationStore.currentConversationId);
22 if (!conversation) {
23 const currentConnectionCtx = connectionStore.currentConnectionCtx;
24 if (!currentConnectionCtx) {
25 conversation = conversationStore.createConversation();
26 } else {
27 conversation = conversationStore.createConversation(currentConnectionCtx.connection.id, currentConnectionCtx.database?.name);
28 }
29 }
30 await sendMessage(content);
31 };
32
33 return (
34 <div className={`${className || ""} w-full h-full flex flex-col justify-start items-center`}>
35 <div className="w-96 max-w-full font-medium leading-loose mb-8">
36 <img src={isDarkMode ? "/chat-logo-and-text-dark-mode.webp" : "/chat-logo-and-text.webp"} alt="sql-chat-logo" />
37 </div>
38 <div className="w-full grid grid-cols-2 sm:grid-cols-3 gap-4">
39 <div className="w-full flex flex-col justify-start items-center">
40 <Icon.BsSun className="w-8 h-auto opacity-80" />
41 <span className="mt-2 mb-4">Examples</span>
42 {examples.map((example) => (
43 <div
44 key={example}
45 className="w-full rounded-lg px-4 py-3 text-sm mb-4 cursor-pointer bg-gray-50 dark:bg-zinc-700 hover:opacity-80"
46 onClick={() => handleExampleClick(example)}
47 >
48 {`"${example}"`} →
49 </div>
50 ))}
51 </div>
52 <div className="w-full flex flex-col justify-start items-center">
53 <Icon.BsLightning className="w-8 h-auto opacity-80" />
54 <span className="mt-2 mb-4">Capabilities</span>
55 <div className="w-full bg-gray-50 dark:bg-zinc-700 rounded-lg px-4 py-3 text-sm mb-4">
56 Remembers what user said earlier in the conversation
57 </div>
58 <div className="w-full bg-gray-50 dark:bg-zinc-700 rounded-lg px-4 py-3 text-sm mb-4">
59 Allows user to provide follow-up corrections
60 </div>
61 </div>
62 <div className="w-full hidden sm:flex flex-col justify-start items-center">
63 <Icon.BsEmojiNeutral className="w-8 h-auto opacity-80" />
64 <span className="mt-2 mb-4">Limitations</span>
65 <div className="w-full bg-gray-50 dark:bg-zinc-700 rounded-lg px-4 py-3 text-sm mb-4">
66 May occasionally generate incorrect information
67 </div>
68 <div className="w-full bg-gray-50 dark:bg-zinc-700 rounded-lg px-4 py-3 text-sm mb-4">
69 May occasionally produce harmful instructions or biased content
70 </div>

Callers

nothing calls this directly

Calls 2

useDarkModeFunction · 0.85
handleExampleClickFunction · 0.85

Tested by

no test coverage detected