diff --git a/frontend/src/components/HomeComponents/SetupGuide/CopyableCode.tsx b/frontend/src/components/HomeComponents/SetupGuide/CopyableCode.tsx index 406318f..73f9a3f 100644 --- a/frontend/src/components/HomeComponents/SetupGuide/CopyableCode.tsx +++ b/frontend/src/components/HomeComponents/SetupGuide/CopyableCode.tsx @@ -2,6 +2,7 @@ import { CopyIcon, Eye, EyeOff } from 'lucide-react'; import CopyToClipboard from 'react-copy-to-clipboard'; import { toast } from 'react-toastify'; import { useState } from 'react'; +import Tooltip from '../../ui/tooltip'; interface CopyableCodeProps { text: string; @@ -50,24 +51,36 @@ export const CopyableCode = ({ {isSensitive && ( - + + )} handleCopy(copyText)}> - + + + ); diff --git a/frontend/src/components/ui/tooltip.tsx b/frontend/src/components/ui/tooltip.tsx new file mode 100644 index 0000000..b39d238 --- /dev/null +++ b/frontend/src/components/ui/tooltip.tsx @@ -0,0 +1,25 @@ +interface TooltipProps { + children: React.ReactNode; + title: string; + position?: 'top' | 'bottom'; +} + +const Tooltip = ({ children, title, position }: TooltipProps) => { + const topClasses = + 'after:-translate-x-1/2 after:left-1/2 group-hover:bottom-full group-hover:opacity-100 -translate-y-2.5 bottom-1/2 group-focus:opacity-100 group-focus:bottom-full'; + const bottomClasses = + 'after:top-0 after:-translate-y-1/2 after:left-1/2 after:-translate-x-1/2 top-1/2 group-hover:top-full group-hover:opacity-100 translate-y-2.5 group-focus:opacity-100 group-focus:top-full'; + + return ( +
+ {children} + + {title} + +
+ ); +}; + +export default Tooltip;