Skip to content

Commit a5f23bd

Browse files
committed
adding new cta in support page/ nebula modal
1 parent 3825563 commit a5f23bd

File tree

3 files changed

+71
-10
lines changed

3 files changed

+71
-10
lines changed

apps/dashboard/src/app/(app)/(dashboard)/support/page.tsx

Lines changed: 67 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { Button } from "@/components/ui/button";
22
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
3+
import { getThirdwebClient } from "@/constants/thirdweb.server";
4+
import { NebulaIcon } from "app/nebula-app/(app)/icons/NebulaIcon";
35
import { BookOpenIcon, ChevronRightIcon } from "lucide-react";
46
import type { Metadata } from "next";
57
import Image from "next/image";
@@ -9,6 +11,11 @@ import contractsIcon from "../../../../../public/assets/support/contracts.png";
911
import engineIcon from "../../../../../public/assets/support/engine.png";
1012
import miscIcon from "../../../../../public/assets/support/misc.svg";
1113
import connectIcon from "../../../../../public/assets/support/wallets.png";
14+
import { NebulaFloatingChatButton } from "../../../nebula-app/(app)/components/FloatingChat/FloatingChat";
15+
import {
16+
getAuthToken,
17+
getAuthTokenWalletAddress,
18+
} from "../../api/lib/getAuthToken";
1219

1320
export const metadata: Metadata = {
1421
title: "thirdweb Support",
@@ -112,7 +119,26 @@ const HELP_PRODUCTS = [
112119
},
113120
] as const;
114121

115-
export default function SupportPage() {
122+
export default async function SupportPage() {
123+
const [authToken, accountAddress] = await Promise.all([
124+
getAuthToken(),
125+
getAuthTokenWalletAddress(),
126+
]);
127+
128+
const client = getThirdwebClient({
129+
jwt: authToken,
130+
teamId: undefined,
131+
});
132+
133+
const supportPromptPrefix =
134+
"You are a Customer Success Agent at thirdweb, assisting customers with blockchain and Web3-related issues. Use the following details to craft a professional, empathetic response: ";
135+
const examplePrompts = [
136+
"ERC20 - Transfer Amount Exceeds Allowance",
137+
"Replacement transaction underpriced / Replacement fee too low",
138+
"Nonce too low: next nonce #, tx nonce #",
139+
"Nonce too high",
140+
];
141+
116142
return (
117143
<main className="flex flex-col gap-12 pb-12">
118144
<div className="bg-gradient-to-b from-card/0 to-card py-20">
@@ -127,12 +153,31 @@ export default function SupportPage() {
127153
How can we help?
128154
</h1>
129155
<p className="text-center text-lg text-muted-foreground">
130-
Our dedicated support team is here to help you with any questions
131-
or issues you may have. Contact us today and let us assist you.
156+
Get instant answers with Nebula AI, our onchain support assistant.
157+
Still need help? You can also create a support case to reach our
158+
team.
132159
</p>
133-
<Button variant="default" className="mt-6" size="lg" asChild>
134-
<Link href="/support/create-ticket">Get Support</Link>
135-
</Button>
160+
{/* biome-ignore lint/nursery/useSortedClasses: <explanation> */}
161+
<div className="mt-6 w-full flex flex-col items-center gap-3">
162+
<Button
163+
variant="default"
164+
className="gap-2 rounded-full"
165+
size="default"
166+
>
167+
<NebulaIcon className="size-4" />
168+
Ask Nebula AI for support
169+
</Button>
170+
171+
<Link
172+
href="/support/create-ticket"
173+
target="_blank"
174+
rel="noreferrer"
175+
// biome-ignore lint/nursery/useSortedClasses: <explanation>
176+
className="text-sm text-muted-foreground hover:underline"
177+
>
178+
Open a support case
179+
</Link>
180+
</div>
136181
</div>
137182
</header>
138183
</div>
@@ -185,6 +230,22 @@ export default function SupportPage() {
185230
))}
186231
</div>
187232
</section>
233+
234+
<NebulaFloatingChatButton
235+
pageType="support"
236+
authToken={authToken ?? undefined}
237+
label="Ask Nebula AI for support"
238+
client={client}
239+
nebulaParams={{
240+
messagePrefix: supportPromptPrefix,
241+
chainIds: [],
242+
wallet: accountAddress ?? undefined,
243+
}}
244+
examplePrompts={examplePrompts.map((prompt) => ({
245+
title: prompt,
246+
message: prompt,
247+
}))}
248+
/>
188249
</main>
189250
);
190251
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import { NebulaIcon } from "../../icons/NebulaIcon";
2222
const LazyFloatingChatContent = lazy(() => import("./FloatingChatContent"));
2323

2424
export function NebulaFloatingChatButton(props: {
25-
pageType: "chain" | "contract";
25+
pageType: "chain" | "contract" | "support";
2626
authToken: string | undefined;
2727
examplePrompts: ExamplePrompt[];
2828
label: string;
@@ -104,7 +104,7 @@ function NebulaChatUIContainer(props: {
104104
hasBeenOpened: boolean;
105105
authToken: string | undefined;
106106
examplePrompts: ExamplePrompt[];
107-
pageType: "chain" | "contract";
107+
pageType: "chain" | "contract" | "support";
108108
client: ThirdwebClient;
109109
nebulaParams:
110110
| {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export default function FloatingChatContent(props: {
2525
authToken: string | undefined;
2626
client: ThirdwebClient;
2727
examplePrompts: ExamplePrompt[];
28-
pageType: "chain" | "contract";
28+
pageType: "chain" | "contract" | "support";
2929
nebulaParams:
3030
| {
3131
messagePrefix: string;
@@ -52,7 +52,7 @@ export default function FloatingChatContent(props: {
5252
function FloatingChatContentLoggedIn(props: {
5353
authToken: string;
5454
client: ThirdwebClient;
55-
pageType: "chain" | "contract";
55+
pageType: "chain" | "contract" | "support";
5656
examplePrompts: ExamplePrompt[];
5757
nebulaParams:
5858
| {

0 commit comments

Comments
 (0)