diff --git a/.env.example b/.env.example index 8284fec5913..b513cd1ee7c 100644 --- a/.env.example +++ b/.env.example @@ -4,4 +4,4 @@ # used for unit tests that hit real IPFS gateway # get a secret key from https://thirdweb.com/create-api-key # Learn more about API keys. https://portal.thirdweb.com/account/api-keys -TW_SECRET_KEY="" +TW_SECRET_KEY="" \ No newline at end of file diff --git a/apps/dashboard/src/app/(app)/(dashboard)/support/page.tsx b/apps/dashboard/src/app/(app)/(dashboard)/support/page.tsx index 813f444d9b0..1f0d9fd10e0 100644 --- a/apps/dashboard/src/app/(app)/(dashboard)/support/page.tsx +++ b/apps/dashboard/src/app/(app)/(dashboard)/support/page.tsx @@ -1,5 +1,6 @@ import { Button } from "@/components/ui/button"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; +import { getThirdwebClient } from "@/constants/thirdweb.server"; import { BookOpenIcon, ChevronRightIcon } from "lucide-react"; import type { Metadata } from "next"; import Image from "next/image"; @@ -9,6 +10,11 @@ import contractsIcon from "../../../../../public/assets/support/contracts.png"; import engineIcon from "../../../../../public/assets/support/engine.png"; import miscIcon from "../../../../../public/assets/support/misc.svg"; import connectIcon from "../../../../../public/assets/support/wallets.png"; +import { NebulaFloatingChatButton } from "../../../nebula-app/(app)/components/FloatingChat/FloatingChat"; +import { + getAuthToken, + getAuthTokenWalletAddress, +} from "../../api/lib/getAuthToken"; export const metadata: Metadata = { title: "thirdweb Support", @@ -112,7 +118,26 @@ const HELP_PRODUCTS = [ }, ] as const; -export default function SupportPage() { +export default async function SupportPage() { + const [authToken, accountAddress] = await Promise.all([ + getAuthToken(), + getAuthTokenWalletAddress(), + ]); + + const client = getThirdwebClient({ + jwt: authToken, + teamId: undefined, + }); + + const supportPromptPrefix = + "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: "; + const examplePrompts = [ + "ERC20 - Transfer Amount Exceeds Allowance", + "Replacement transaction underpriced / Replacement fee too low", + "Nonce too low: next nonce #, tx nonce #", + "Nonce too high", + ]; + return (
@@ -185,6 +210,22 @@ export default function SupportPage() { ))}
+ + ({ + title: prompt, + message: prompt, + }))} + />
); } diff --git a/apps/dashboard/src/app/nebula-app/(app)/components/ChatBar.tsx b/apps/dashboard/src/app/nebula-app/(app)/components/ChatBar.tsx index 87883f2459a..eed6f239b43 100644 --- a/apps/dashboard/src/app/nebula-app/(app)/components/ChatBar.tsx +++ b/apps/dashboard/src/app/nebula-app/(app)/components/ChatBar.tsx @@ -173,7 +173,6 @@ export function ChatBar(props: { )} - {/* Send / Stop */} {props.isChatStreaming ? (