diff --git a/apps/dashboard/app/(app)/apis/[apiId]/keys/[keyAuthId]/[keyId]/settings/page.tsx b/apps/dashboard/app/(app)/apis/[apiId]/keys/[keyAuthId]/[keyId]/settings/page.tsx
index 087c96f2cf..aed7ebf2e3 100644
--- a/apps/dashboard/app/(app)/apis/[apiId]/keys/[keyAuthId]/[keyId]/settings/page.tsx
+++ b/apps/dashboard/app/(app)/apis/[apiId]/keys/[keyAuthId]/[keyId]/settings/page.tsx
@@ -3,6 +3,7 @@ import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/com
import { Code } from "@/components/ui/code";
import { getTenantId } from "@/lib/auth";
import { type Key, and, db, eq, isNull, schema } from "@/lib/db";
+import { getLastUsed } from "@/lib/tinybird";
import { ArrowLeft } from "lucide-react";
import Link from "next/link";
import { notFound } from "next/navigation";
@@ -42,6 +43,10 @@ export default async function SettingsPage(props: Props) {
return notFound();
}
+ const lastUsed = await getLastUsed({ keyId: key.id }).then(
+ (res) => res.data.at(0)?.lastUsed ?? 0,
+ );
+
return (
-
+
);
diff --git a/apps/dashboard/app/(app)/apis/[apiId]/keys/[keyAuthId]/[keyId]/settings/reroll-confirmation-dialog.tsx b/apps/dashboard/app/(app)/apis/[apiId]/keys/[keyAuthId]/[keyId]/settings/reroll-confirmation-dialog.tsx
index 415837f3a5..56b8c93ce1 100644
--- a/apps/dashboard/app/(app)/apis/[apiId]/keys/[keyAuthId]/[keyId]/settings/reroll-confirmation-dialog.tsx
+++ b/apps/dashboard/app/(app)/apis/[apiId]/keys/[keyAuthId]/[keyId]/settings/reroll-confirmation-dialog.tsx
@@ -1,3 +1,4 @@
+"use client";
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
import { Button } from "@/components/ui/button";
import {
@@ -13,9 +14,10 @@ type Props = {
open: boolean;
setOpen: (open: boolean) => void;
onClick: () => void;
+ lastUsed: number;
};
-export function RerollConfirmationDialog({ open, setOpen, onClick }: Props) {
+export function RerollConfirmationDialog({ open, setOpen, onClick, lastUsed }: Props) {
return (