-
Notifications
You must be signed in to change notification settings - Fork 619
[Dashboard] Add ai usage billing banner to dashboard #8104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -1,6 +1,6 @@ | ||||||||
| "use client"; | ||||||||
|
|
||||||||
| import { ArrowUpRightIcon } from "lucide-react"; | ||||||||
| import { ArrowUpRightIcon, InfoIcon } from "lucide-react"; | ||||||||
| import type { ThirdwebClient } from "thirdweb"; | ||||||||
| import { Button } from "@/components/ui/button"; | ||||||||
| import { NebulaIcon } from "@/icons/NebulaIcon"; | ||||||||
|
|
@@ -24,6 +24,7 @@ export function EmptyStateChatPageContent(props: { | |||||||
| }) { | ||||||||
| return ( | ||||||||
| <div className="overflow-hidden py-10 lg:py-16"> | ||||||||
| <AIUsageBanner /> | ||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Make the banner’s positioning deterministic by making the container
Apply: - <div className="overflow-hidden py-10 lg:py-16">
+ <div className="relative overflow-hidden py-10 lg:py-16">📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||
| {props.showAurora && ( | ||||||||
| <Aurora className="top-0 left-1/2 h-[800px] w-[1000px] text-[hsl(var(--primary-foreground)/8%)] lg:w-[150%] dark:text-[hsl(var(--primary-foreground)/10%)]" /> | ||||||||
| )} | ||||||||
|
|
@@ -165,3 +166,35 @@ const Aurora: React.FC<AuroraProps> = ({ className }) => { | |||||||
| /> | ||||||||
| ); | ||||||||
| }; | ||||||||
|
|
||||||||
| function AIUsageBanner() { | ||||||||
| return ( | ||||||||
| <div className="absolute top-0 left-0 right-0 z-10 flex justify-center px-4 pt-4"> | ||||||||
| <div className="max-w-4xl"> | ||||||||
| <div className="relative overflow-hidden rounded-lg border border-blue-200 bg-gradient-to-r from-blue-50 to-blue-50/50 p-3 shadow-sm dark:border-blue-800 dark:from-blue-950/50 dark:to-blue-950/20"> | ||||||||
| <div className="relative flex items-center gap-3 px-2"> | ||||||||
| <div className="mt-0.5 flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-blue-100 dark:bg-blue-900"> | ||||||||
| <InfoIcon className="size-3.5 text-blue-600 dark:text-blue-400" /> | ||||||||
| </div> | ||||||||
|
|
||||||||
| <div className="flex-1 text-sm"> | ||||||||
| <p className="text-blue-800 dark:text-blue-200"> | ||||||||
| thirdweb AI usage is billed based on number of tokens used. See | ||||||||
| the{" "} | ||||||||
| <a | ||||||||
| href="https://thirdweb.com/pricing" | ||||||||
| target="_blank" | ||||||||
| rel="noopener noreferrer" | ||||||||
| className="font-medium text-blue-700 underline decoration-blue-300 underline-offset-2 transition-colors hover:text-blue-800 hover:decoration-blue-500 dark:text-blue-300 dark:decoration-blue-600 dark:hover:text-blue-200 dark:hover:decoration-blue-400" | ||||||||
| > | ||||||||
| pricing page | ||||||||
| </a> | ||||||||
| . | ||||||||
| </p> | ||||||||
| </div> | ||||||||
| </div> | ||||||||
| </div> | ||||||||
| </div> | ||||||||
| </div> | ||||||||
| ); | ||||||||
| } | ||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
Don’t silently disable AnnouncementBanner; gate or delete to avoid regressions.
Commenting out the render and returning null removes all global announcements and conflicts with our guidance to use AnnouncementBanner for notices. Either gate via a flag or delete the feature entirely (and its UI) to avoid dead code.
Apply one of these:
Quick check to ensure no pages depend on this banner:
🏁 Script executed:
Length of output: 27
🏁 Script executed:
Length of output: 2070
Don't silently disable AnnouncementBanner — gate it or remove the feature.
AnnouncementBanner currently returns null but is imported and rendered in multiple layouts, which removes global announcements (regression).
Apply one of: gate behind a feature flag or delete the component and its usages. Suggested minimal change:
📝 Committable suggestion
🤖 Prompt for AI Agents