diff --git a/components/apikey/ApikeysManagement.tsx b/components/apikey/ApikeysManagement.tsx index 20a3508..c9263f8 100644 --- a/components/apikey/ApikeysManagement.tsx +++ b/components/apikey/ApikeysManagement.tsx @@ -2,6 +2,10 @@ 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'; +import { Label } from '../ui/label'; /** * Utility to copy text to clipboard @@ -61,7 +65,6 @@ const NewKeyDialog = ({ isOpen, onClose, userId, onKeyGenerated }) => { if (plainTextKey) { setPlainTextKey(plainTextKey); - onKeyGenerated(); } else { setError('Failed to generate key.'); } @@ -90,8 +93,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,19 +106,22 @@ 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}

} @@ -168,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); @@ -206,7 +211,7 @@ const ApiKeysDashboard = () => { // Main Dashboard Render (Light theme) return ( -
+
{

- {message && ( + {/* {message && (
{message.text}
)} - + */} {/* Key List / Skeleton Loader */} +
{isDataLoading ? ( ) : ( -
+
{keys.length === 0 ? (

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

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

+

{key.name}

@@ -291,8 +298,8 @@ const ApiKeysDashboard = () => { @@ -330,7 +337,9 @@ const ApiKeysDashboard = () => {
))} +
+ )}
)}