mirror of
https://github.com/luckfox-eng29/kvm.git
synced 2026-06-03 11:52:57 +02:00
* Upgrade ESLINT and fix issues * feat: add frontend linting job to GitHub Actions workflow * Move UI linting to separate file * More linting fixes * Remove pull_request trigger from UI linting workflow * Update UI linting workflow * Rename frontend-lint workflow to ui-lint for clarity
33 lines
866 B
TypeScript
33 lines
866 B
TypeScript
import Card from "@components/Card";
|
|
|
|
export interface CustomTooltipProps {
|
|
payload: { payload: { date: number; stat: number }; unit: string }[];
|
|
}
|
|
|
|
export default function CustomTooltip({ payload }: CustomTooltipProps) {
|
|
if (payload?.length) {
|
|
const toolTipData = payload[0];
|
|
const { date, stat } = toolTipData.payload;
|
|
|
|
return (
|
|
<Card>
|
|
<div className="p-2 text-black dark:text-white">
|
|
<div className="font-semibold">
|
|
{new Date(date * 1000).toLocaleTimeString()}
|
|
</div>
|
|
<div className="space-y-1">
|
|
<div className="flex items-center gap-x-1">
|
|
<div className="h-[2px] w-2 bg-blue-700" />
|
|
<span >
|
|
{stat} {toolTipData?.unit}
|
|
</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</Card>
|
|
);
|
|
}
|
|
|
|
return null;
|
|
}
|