Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a81899d

Browse files
[Dashboard] Add ai usage billing banner to dashboard (#8104)
Co-authored-by: Cursor Agent <[email protected]>
1 parent b366d56 commit a81899d

File tree

5 files changed

+43
-11
lines changed

5 files changed

+43
-11
lines changed

apps/dashboard/src/@/components/misc/AnnouncementBanner.tsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,12 @@ function AnnouncementBannerUI(props: {
4444
}
4545

4646
export function AnnouncementBanner() {
47-
return (
48-
<AnnouncementBannerUI
49-
href="https://blog.thirdweb.com/the-fastest-way-to-build-web3-applications/"
50-
label="We have re-branded our Engine, Payments, and Connect products. Please read the full blog post for details on changes"
51-
trackingLabel="product-rebrand"
52-
/>
53-
);
47+
// return (
48+
// <AnnouncementBannerUI
49+
// href="https://blog.thirdweb.com/the-fastest-way-to-build-web3-applications/"
50+
// label="We have re-branded our Engine, Payments, and Connect products. Please read the full blog post for details on changes"
51+
// trackingLabel="product-rebrand"
52+
// />
53+
// );
54+
return null;
5455
}

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/ai/components/EmptyStateChatPageContent.tsx

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"use client";
22

3-
import { ArrowUpRightIcon } from "lucide-react";
3+
import { ArrowUpRightIcon, InfoIcon } from "lucide-react";
44
import type { ThirdwebClient } from "thirdweb";
55
import { Button } from "@/components/ui/button";
66
import { NebulaIcon } from "@/icons/NebulaIcon";
@@ -24,6 +24,7 @@ export function EmptyStateChatPageContent(props: {
2424
}) {
2525
return (
2626
<div className="overflow-hidden py-10 lg:py-16">
27+
<AIUsageBanner />
2728
{props.showAurora && (
2829
<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%)]" />
2930
)}
@@ -165,3 +166,35 @@ const Aurora: React.FC<AuroraProps> = ({ className }) => {
165166
/>
166167
);
167168
};
169+
170+
function AIUsageBanner() {
171+
return (
172+
<div className="absolute top-0 left-0 right-0 z-10 flex justify-center px-4 pt-4">
173+
<div className="max-w-4xl">
174+
<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">
175+
<div className="relative flex items-center gap-3 px-2">
176+
<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">
177+
<InfoIcon className="size-3.5 text-blue-600 dark:text-blue-400" />
178+
</div>
179+
180+
<div className="flex-1 text-sm">
181+
<p className="text-blue-800 dark:text-blue-200">
182+
thirdweb AI usage is billed based on number of tokens used. See
183+
the{" "}
184+
<a
185+
href="https://thirdweb.com/pricing"
186+
target="_blank"
187+
rel="noopener noreferrer"
188+
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"
189+
>
190+
pricing page
191+
</a>
192+
.
193+
</p>
194+
</div>
195+
</div>
196+
</div>
197+
</div>
198+
</div>
199+
);
200+
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export function EmptyStateChatPageContent(props: {
2323
onLoginClick: undefined | (() => void);
2424
}) {
2525
return (
26-
<div className="overflow-hidden py-10 lg:py-16">
26+
<div className="relative overflow-hidden py-10 lg:py-16">
2727
{props.showAurora && (
2828
<Aurora className="top-0 left-1/2 h-[800px] w-[1000px] text-[hsl(var(--nebula-pink-foreground)/8%)] lg:w-[150%] dark:text-[hsl(var(--nebula-pink-foreground)/10%)]" />
2929
)}

apps/playground-web/src/app/payments/x402/page.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ function ServerCodeExample() {
5959
6060
import { facilitator, verifyPayment } from "thirdweb/x402";
6161
import { createThirdwebClient } from "thirdweb";
62-
import { paymentMiddleware } from "x402-next";
6362
6463
const client = createThirdwebClient({ secretKey: "your-secret-key" });
6564
const thirdwebX402Facilitator = facilitator({

apps/portal/src/app/payments/x402/page.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ Here's an example with a Next.js middleware:
5050
```typescript
5151
import { createThirdwebClient } from "thirdweb";
5252
import { facilitator, verifyPayment } from "thirdweb/x402";
53-
import { paymentMiddleware } from "x402-next";
5453

5554
const client = createThirdwebClient({ secretKey: "your-secret-key" });
5655
const thirdwebX402Facilitator = facilitator({

0 commit comments

Comments
 (0)