mirror of
https://github.com/karl0ss/homepage.git
synced 2025-04-29 12:03:41 +01:00
18 lines
474 B
JavaScript
18 lines
474 B
JavaScript
export default function Tooltip({ active, payload, formatter }) {
|
|
if (active && payload && payload.length) {
|
|
return (
|
|
<div className="bg-theme-800/80 rounded-md text-theme-200 px-2 py-0">
|
|
{payload.map((pld, id) => (
|
|
<div key={Math.random()} className="first-of-type:pt-0 pt-0.5">
|
|
<div>
|
|
{formatter(pld.value)} {payload[id].name}
|
|
</div>
|
|
</div>
|
|
))}
|
|
</div>
|
|
);
|
|
}
|
|
|
|
return null;
|
|
}
|