Open-source, secure environment with real-world tools for enterprise-grade agents.
Python agentaiai-agentai-agentscode-interpretercopilotdevelopmentdevtoolsgptgpt-4javascriptllmnextjsopenaipythonreactsoftwaretypescript
ask user to sign in if signed out and on the usage page
Vasek Mlejnskyaf71e20b657f
diff --git a/apps/docs/src/app/usage/Credits.tsx b/apps/docs/src/app/usage/Credits.tsxindex df22892f2..4a69e2c60 100644--- a/apps/docs/src/app/usage/Credits.tsx+++ b/apps/docs/src/app/usage/Credits.tsx@@ -6,6 +6,7 @@ import {} from 'lucide-react'import { useUsage } from '@/utils/useUsage'+import { useUser } from '@/utils/useUser'function usedCredits(totalCosts: number, unpaidCosts: number) {return totalCosts - unpaidCosts@@ -17,12 +18,24 @@ function formatCurrency(value: number) {function Credits() {// TODO: If not logged in, show a message to log in+ const { user } = useUser()+// TODO: Show user their plan// TODO: Add "switch tier"/"manage billing" buttonconst { credits, costs } = useUsage()+ if (!user) {+ return (+ <div>+ <span>Sign in to see your usage</span>+ </div>+ )+ }+return (- <div className="flex flex-col justify-start items-start">+ <div className="flex flex-col justify-start items-start gap-4">+ <span>Your sandbox usage for the past 3 months</span>+<div className="flex flex-col justify-start items-start gap-1"><div className="flex items-center gap-1"><Ticket size={20} />diff --git a/apps/docs/src/app/usage/page.mdx b/apps/docs/src/app/usage/page.mdxindex 952a55797..09dabbc4f 100644--- a/apps/docs/src/app/usage/page.mdx+++ b/apps/docs/src/app/usage/page.mdx@@ -2,6 +2,4 @@ import Credits from './Credits'# Usage-Your sandbox usage for the past 3 months-<Credits/>\ No newline at end of file