From 68bffc6720ade0a57c4e4627e5d681f36ed7bdc5 Mon Sep 17 00:00:00 2001 From: Muhammad-Jay Date: Mon, 8 Dec 2025 16:43:08 +0100 Subject: [PATCH 1/2] fix: Minor adjustment to ApikeysManagement component --- components/apikey/ApikeysManagement.tsx | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/components/apikey/ApikeysManagement.tsx b/components/apikey/ApikeysManagement.tsx index 20a3508..654bb26 100644 --- a/components/apikey/ApikeysManagement.tsx +++ b/components/apikey/ApikeysManagement.tsx @@ -2,6 +2,9 @@ import { useAuth } from '@/context/AuthContext'; import { fetchUserApiKeys, generateAndStoreNewApiKey, revokeOrUnrevokeApiKey } from '@/lib/db/content'; import React, { useState, useEffect, useCallback, useMemo, memo } from 'react'; +import { Button } from '../ui/button'; +import { ScrollArea } from '../ui/scroll-area'; +import { cn } from '@/lib/utils'; /** * Utility to copy text to clipboard @@ -61,7 +64,6 @@ const NewKeyDialog = ({ isOpen, onClose, userId, onKeyGenerated }) => { if (plainTextKey) { setPlainTextKey(plainTextKey); - onKeyGenerated(); } else { setError('Failed to generate key.'); } @@ -90,8 +92,8 @@ const NewKeyDialog = ({ isOpen, onClose, userId, onKeyGenerated }) => { {plainTextKey ? (
-

- ⚠️ SUCCESS: Copy the key below. It will not be shown again. +

+ SUCCESS: Copy the key below. It will not be shown again.

{plainTextKey} @@ -103,9 +105,9 @@ const NewKeyDialog = ({ isOpen, onClose, userId, onKeyGenerated }) => {
- +
) : (
@@ -206,7 +208,7 @@ const ApiKeysDashboard = () => { // Main Dashboard Render (Light theme) return ( -
+
{ )} {/* Key List / Skeleton Loader */} +
{isDataLoading ? ( ) : ( -
+
{keys.length === 0 ? (

You have no API keys. Click "New Key" to create one.

) : ( -
+
+ {keys.map((key) => (
{
))} +
+ )}
)} From 105f1e2c5f2d962de39ebb2b95aea2f9e7886ac8 Mon Sep 17 00:00:00 2001 From: Muhammad-Jay Date: Mon, 8 Dec 2025 18:57:42 +0100 Subject: [PATCH 2/2] fix: Another minor adjustment to ApikeysManagement component --- components/apikey/ApikeysManagement.tsx | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/components/apikey/ApikeysManagement.tsx b/components/apikey/ApikeysManagement.tsx index 654bb26..c9263f8 100644 --- a/components/apikey/ApikeysManagement.tsx +++ b/components/apikey/ApikeysManagement.tsx @@ -5,6 +5,7 @@ import React, { useState, useEffect, useCallback, useMemo, memo } from 'react'; import { Button } from '../ui/button'; import { ScrollArea } from '../ui/scroll-area'; import { cn } from '@/lib/utils'; +import { Label } from '../ui/label'; /** * Utility to copy text to clipboard @@ -110,14 +111,17 @@ const NewKeyDialog = ({ isOpen, onClose, userId, onKeyGenerated }) => {
) : ( - + + setKeyName(e.target.value)} required - className="w-full p-3 bg-white border border-gray-300 rounded-lg focus:ring-1 focus:ring-gray-900 focus:outline-none placeholder-gray-500 text-sm" + className="w-full p-2 bg-white border border-neutral-300 rounded-md focus:ring-1 focus:ring-neutral-900 focus:outline-none placeholder-neutral-500 text-sm" disabled={isLoading} /> {error &&

{error}

} @@ -170,7 +174,6 @@ const ApiKeysDashboard = () => { const handleRevoke = async (keyId, state) => { - if (!window.confirm("Are you sure you want to permanently revoke this API key? This cannot be undone.")) return; setIsLoading(true); setMessage(null); @@ -239,12 +242,12 @@ const ApiKeysDashboard = () => {

- {message && ( + {/* {message && (
{message.text}
)} - + */} {/* Key List / Skeleton Loader */}
@@ -257,12 +260,12 @@ const ApiKeysDashboard = () => { You have no API keys. Click "New Key" to create one.

) : ( -
- +
+ {keys.map((key) => (
{
-

+

{key.name}

@@ -295,8 +298,8 @@ const ApiKeysDashboard = () => {