Skip to content

Commit 15178b2

Browse files
committed
[NEB-71] Nebula: Update example prompts (#5957)
<!-- start pr-codex --> ## PR-Codex overview This PR introduces a new type `ExamplePrompt` and a list of example prompts in `examplePrompts.ts`. It replaces hardcoded example prompts in `EmptyStateChatPageContent.tsx` with a dynamic mapping from the newly created `examplePrompts`, enhancing maintainability and readability. ### Detailed summary - Added type `ExamplePrompt` with `title` and `message` properties. - Created `examplePrompts` array containing several example prompts. - Refactored `EmptyStateChatPageContent.tsx` to dynamically render `ExamplePrompt` components using `examplePrompts`. - Removed hardcoded example prompts from `EmptyStateChatPageContent.tsx`. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
1 parent afd0ccf commit 15178b2

File tree

2 files changed

+43
-39
lines changed

2 files changed

+43
-39
lines changed

apps/dashboard/src/app/nebula-app/(app)/components/EmptyStateChatPageContent.tsx

Lines changed: 11 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
"use client";
22

3+
import { Button } from "@/components/ui/button";
34
import { ArrowUpRightIcon } from "lucide-react";
4-
import { Button } from "../../../../@/components/ui/button";
5+
import { examplePrompts } from "../data/examplePrompts";
56
import { NebulaIcon } from "../icons/NebulaIcon";
67
import { ChatBar } from "./ChatBar";
78

@@ -35,44 +36,15 @@ export function EmptyStateChatPageContent(props: {
3536
/>
3637
<div className="h-5" />
3738
<div className="flex flex-wrap justify-center gap-2.5">
38-
<ExamplePrompt
39-
label="USDC contract address on ethereum"
40-
onClick={() => {
41-
props.sendMessage(
42-
"What is the contract address of USDC on ethereum?",
43-
);
44-
}}
45-
/>
46-
47-
<ExamplePrompt
48-
label="last 5 blocks on polygon"
49-
onClick={() => {
50-
props.sendMessage("What are last 5 blocks on polygon?");
51-
}}
52-
/>
53-
54-
<ExamplePrompt
55-
label="What is thirdweb SDK?"
56-
onClick={() => {
57-
props.sendMessage("What is thirdweb SDK?");
58-
}}
59-
/>
60-
<ExamplePrompt
61-
label="How to add connect wallet button"
62-
onClick={() => {
63-
props.sendMessage(
64-
"How to add connect wallet button on React app?",
65-
);
66-
}}
67-
/>
68-
<ExamplePrompt
69-
label="Show transaction details"
70-
onClick={() => {
71-
props.sendMessage(
72-
"Show transaction details of 0xff9624116c352c8b090203fbbb563baf32d2b1944f9ac281ff2de6b7d948030e on ethereum",
73-
);
74-
}}
75-
/>
39+
{examplePrompts.map((prompt) => {
40+
return (
41+
<ExamplePrompt
42+
key={prompt.title}
43+
label={prompt.title}
44+
onClick={() => props.sendMessage(prompt.message)}
45+
/>
46+
);
47+
})}
7648
</div>
7749
</div>
7850
</div>
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
type ExamplePrompt = {
2+
title: string;
3+
message: string;
4+
};
5+
6+
// Note:
7+
// Keep the title as short as possible so 2 of them can fit in a single row on desktop viewport
8+
// title is only used for displaying the example - the `message` is sent to server when user clicks on the example - it can be as long and descriptive as needed
9+
10+
export const examplePrompts: ExamplePrompt[] = [
11+
{
12+
title: "Deploy an ERC-20 Token",
13+
message:
14+
"Deploy an ERC-20 Token with name 'Hello World', description 'Hello world token deployed by Nebula', and symbol 'HELLO'",
15+
},
16+
{
17+
title: "USDC contract address on Ethereum",
18+
message: "What is the USDC contract address on Ethereum?",
19+
},
20+
{
21+
title: "Analyze WETH smart contract",
22+
message: "Analyze 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2 on ethereum",
23+
},
24+
{
25+
title: "Transfer 0.001 ETH to thirdweb.eth",
26+
message: "Transfer 0.001 ETH to thirdweb.eth",
27+
},
28+
{
29+
title: "Using session keys in Unity",
30+
message: "How to use session key in Unity?",
31+
},
32+
];

0 commit comments

Comments
 (0)