diff --git a/frontend/src/pages/Security/Providers.tsx b/frontend/src/pages/Security/Providers.tsx index 6ed02ccc..876de7a3 100644 --- a/frontend/src/pages/Security/Providers.tsx +++ b/frontend/src/pages/Security/Providers.tsx @@ -1,4 +1,4 @@ -import { useState } from 'react'; +import { useState, useRef } from 'react'; import { useAuthProviders } from '../../hooks/useSecurity'; import { Button } from '../../components/ui/Button'; import { Plus, Edit, Trash2, Globe } from 'lucide-react'; @@ -19,6 +19,47 @@ interface ProviderFormData { enabled: boolean; } +interface HelpTooltipProps { + content: React.ReactNode; + position?: 'left' | 'right'; +} + +const HelpTooltip = ({ content, position = 'left' }: HelpTooltipProps) => { + const [isOpen, setIsOpen] = useState(false); + const timeoutRef = useRef | null>(null); + + const handleMouseEnter = () => { + if (timeoutRef.current) clearTimeout(timeoutRef.current); + setIsOpen(true); + }; + + const handleMouseLeave = () => { + timeoutRef.current = setTimeout(() => { + setIsOpen(false); + }, 300); + }; + + return ( +
+ + {isOpen && ( +
+ {content} +
+
+ )} +
+ ); +}; + export default function Providers() { const { providers, createProvider, updateProvider, deleteProvider, isLoading } = useAuthProviders(); const [isModalOpen, setIsModalOpen] = useState(false); @@ -230,23 +271,18 @@ export default function Providers() {
-
- -
-
The public identifier for your OAuth application.
- -
-
-
+ +
The public identifier for your OAuth application.
+
+ + +
+ + } + />
{editingProvider ? 'Client Secret (leave blank to keep)' : 'Client Secret'} -
- -
-
The private key for your OAuth application. Keep this secret and secure!
-
- - -
-
-
-
+ +
The private key for your OAuth application. Keep this secret and secure!
+
+
Google: Google Cloud Console
+
GitHub: Developer Settings
+
+ + } + />