forked from Prompt-Hash-Stellar/prompt-hash
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWeb3Tooltip.tsx
More file actions
35 lines (32 loc) · 1.12 KB
/
Copy pathWeb3Tooltip.tsx
File metadata and controls
35 lines (32 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import React from 'react';
import {
Tooltip,
TooltipContent,
TooltipProvider,
TooltipTrigger,
} from './ui/tooltip';
interface Web3TooltipProps {
term: 'XLM' | 'Soroban' | 'Sign Transaction';
children: React.ReactNode;
}
const explanations: Record<string, string> = {
XLM: 'XLM (Lumen) is the native cryptocurrency of the Stellar network, used for payments and transaction fees.',
Soroban: 'Soroban is the smart contract platform on the Stellar network that enables decentralized applications.',
'Sign Transaction': 'Approving a blockchain action securely using your connected wallet.',
};
export function Web3Tooltip({ term, children }: Web3TooltipProps) {
return (
<TooltipProvider>
<Tooltip delayDuration={300}>
<TooltipTrigger asChild>
<span className="cursor-help underline decoration-dashed underline-offset-4 decoration-slate-400">
{children}
</span>
</TooltipTrigger>
<TooltipContent side="top">
<p className="max-w-[200px] text-center">{explanations[term]}</p>
</TooltipContent>
</Tooltip>
</TooltipProvider>
);
}