From 9facc1621ce96a6bb1ce297e3f8747fb1e556dfa Mon Sep 17 00:00:00 2001 From: Oleg Proskurin Date: Wed, 22 Oct 2025 22:39:56 +0700 Subject: [PATCH] feat: init apikey widget --- .../shared/ApiKeyWidget/apikey-widget.tsx | 126 ++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 apps/landing/src/components/shared/ApiKeyWidget/apikey-widget.tsx diff --git a/apps/landing/src/components/shared/ApiKeyWidget/apikey-widget.tsx b/apps/landing/src/components/shared/ApiKeyWidget/apikey-widget.tsx new file mode 100644 index 0000000..a4c3d41 --- /dev/null +++ b/apps/landing/src/components/shared/ApiKeyWidget/apikey-widget.tsx @@ -0,0 +1,126 @@ +'use client'; + +import { useState } from 'react'; + +interface ApiKeyWidgetProps { + organizationSlug: string; + projectSlug: string; + apiKey: string; + onRevoke: () => void; +} + +export function ApiKeyWidget({ + organizationSlug, + projectSlug, + apiKey, + onRevoke, +}: ApiKeyWidgetProps) { + const [expanded, setExpanded] = useState(false); + const [keyVisible, setKeyVisible] = useState(false); + + return ( +
+ {!expanded ? ( + // Minimized badge + + ) : ( + // Expanded card +
+
+
+

API Key Active

+

+ {organizationSlug} / {projectSlug} +

+
+ +
+ +
+ +
+
+ {keyVisible ? apiKey : '•'.repeat(32)} +
+ +
+
+ + +
+ )} +
+ ); +}