mirror of
https://github.com/Buriburizaem0n/nezha-dash-v1.git
synced 2026-02-05 21:20:08 +00:00
fix: prettier config
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
import React from "react";
|
||||
import { CycleTransferStats } from "@/types/nezha-api";
|
||||
import { CycleTransferStatsClient } from "./CycleTransferStatsClient";
|
||||
import { CycleTransferStats } from "@/types/nezha-api"
|
||||
import React from "react"
|
||||
|
||||
import { CycleTransferStatsClient } from "./CycleTransferStatsClient"
|
||||
|
||||
interface CycleTransferStatsProps {
|
||||
cycleStats: CycleTransferStats;
|
||||
className?: string;
|
||||
cycleStats: CycleTransferStats
|
||||
className?: string
|
||||
}
|
||||
|
||||
export const CycleTransferStatsCard: React.FC<CycleTransferStatsProps> = ({
|
||||
@@ -15,41 +16,39 @@ export const CycleTransferStatsCard: React.FC<CycleTransferStatsProps> = ({
|
||||
<section className="grid grid-cols-1 md:grid-cols-2 gap-2 md:gap-4">
|
||||
{Object.entries(cycleStats).map(([cycleId, cycleData]) => {
|
||||
if (!cycleData.server_name) {
|
||||
return null;
|
||||
return null
|
||||
}
|
||||
|
||||
return Object.entries(cycleData.server_name).map(
|
||||
([serverId, serverName]) => {
|
||||
const transfer = cycleData.transfer?.[serverId] || 0;
|
||||
const nextUpdate = cycleData.next_update?.[serverId];
|
||||
return Object.entries(cycleData.server_name).map(([serverId, serverName]) => {
|
||||
const transfer = cycleData.transfer?.[serverId] || 0
|
||||
const nextUpdate = cycleData.next_update?.[serverId]
|
||||
|
||||
if (!transfer && !nextUpdate) {
|
||||
return null;
|
||||
}
|
||||
if (!transfer && !nextUpdate) {
|
||||
return null
|
||||
}
|
||||
|
||||
return (
|
||||
<CycleTransferStatsClient
|
||||
key={`${cycleId}-${serverId}`}
|
||||
name={cycleData.name}
|
||||
from={cycleData.from}
|
||||
to={cycleData.to}
|
||||
max={cycleData.max}
|
||||
serverStats={[
|
||||
{
|
||||
serverId,
|
||||
serverName,
|
||||
transfer,
|
||||
nextUpdate: nextUpdate || "",
|
||||
},
|
||||
]}
|
||||
className={className}
|
||||
/>
|
||||
);
|
||||
},
|
||||
);
|
||||
return (
|
||||
<CycleTransferStatsClient
|
||||
key={`${cycleId}-${serverId}`}
|
||||
name={cycleData.name}
|
||||
from={cycleData.from}
|
||||
to={cycleData.to}
|
||||
max={cycleData.max}
|
||||
serverStats={[
|
||||
{
|
||||
serverId,
|
||||
serverName,
|
||||
transfer,
|
||||
nextUpdate: nextUpdate || "",
|
||||
},
|
||||
]}
|
||||
className={className}
|
||||
/>
|
||||
)
|
||||
})
|
||||
})}
|
||||
</section>
|
||||
);
|
||||
};
|
||||
)
|
||||
}
|
||||
|
||||
export default CycleTransferStatsCard;
|
||||
export default CycleTransferStatsCard
|
||||
|
||||
Reference in New Issue
Block a user