mirror of
https://github.com/gethomepage/homepage.git
synced 2026-01-11 11:32:09 +08:00
refactor widget
This commit is contained in:
15
src/widgets/glances/components/custom_tooltip.jsx
Normal file
15
src/widgets/glances/components/custom_tooltip.jsx
Normal file
@@ -0,0 +1,15 @@
|
||||
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;
|
||||
};
|
||||
Reference in New Issue
Block a user