+ {message} +
+ ); +} + +/* ------------------------------------------------------------------------- + * Page component + * ---------------------------------------------------------------------- */ + +/** + * Renders the analytics dashboard page. + * + * Checks authentication via `useAuth` (redirects to /login if no token). + * Fetches analytics data from the AgentIdP API using the stored JWT. + * + * @returns JSX element + */ +export default function AnalyticsPage(): React.ReactElement { + const { token, loading: authLoading } = useAuth(true); + + const apiUrl = process.env.NEXT_PUBLIC_API_URL ?? 'http://localhost:3000'; + + const [tokenTrend, setTokenTrend] = + useStateLoading…
++ Token issuance and agent activity for the last 30 days +
++ No agents have issued tokens this month. +
+ )} + {agentUsage.data !== null && agentUsage.data.length > 0 && ( +| + Agent + | ++ Tokens Issued + | +
|---|---|
| + {name} + + {agent_id} + + | ++ {token_count.toLocaleString()} + | +
+ Access your SentryAgent tenant dashboard +
++ {message} +
+ ); +} + +/* ------------------------------------------------------------------------- + * Page component + * ---------------------------------------------------------------------- */ + +/** + * Renders the Tier & Billing settings page. + * + * Checks authentication via `useAuth` (redirects to /login if no token). + * Fetches tier status from the AgentIdP API using the stored JWT. + * + * @returns JSX element + */ +export default function TierPage(): React.ReactElement { + const { token, loading: authLoading } = useAuth(true); + + const apiUrl = process.env.NEXT_PUBLIC_API_URL ?? 'http://localhost:3000'; + + const [status, setStatus] = useStateLoading…
++ Your current plan, daily limits, and usage at a glance +
++ Current Plan +
+| + Metric + | ++ Used + | ++ Limit + | ++ Usage + | +
|---|
+ Counters reset in{' '} + + {formatTimeUntilReset(status.reset_at)} + {' '} + (UTC midnight) +
+