fix: amount type

This commit is contained in:
hamster1963 2024-12-17 11:13:28 +08:00
parent 9d0cbfd7d8
commit 84974f0e78
2 changed files with 44 additions and 20 deletions

View File

@ -72,12 +72,15 @@ export default function ServerCard({ now, serverInfo }: { now: number; serverInf
<p className={cn("text-[10px] text-muted-foreground")}>
: {isNeverExpire ? "永久" : daysLeft + "天"}
</p>
{parsedData.billingDataMod.amount !== "0" ? (
<p className={cn("text-[10px] text-muted-foreground")}>
{parsedData.billingDataMod.amount !== "0" &&
parsedData.billingDataMod.amount !== "-1" ? (
<p className={cn("text-[10px] text-muted-foreground ")}>
: {parsedData.billingDataMod.amount}/{parsedData.billingDataMod.cycle}
</p>
) : parsedData.billingDataMod.amount === "0" ? (
<p className={cn("text-[10px] text-green-600 ")}></p>
) : (
<p className={cn("text-[10px] text-green-600")}></p>
<p className={cn("text-[10px] text-pink-600 ")}></p>
)}
</>
) : (
@ -85,12 +88,15 @@ export default function ServerCard({ now, serverInfo }: { now: number; serverInf
<p className={cn("text-[10px] text-muted-foreground text-red-600")}>
: {daysLeft * -1}
</p>
{parsedData.billingDataMod.amount !== "0" ? (
{parsedData.billingDataMod.amount !== "0" &&
parsedData.billingDataMod.amount !== "-1" ? (
<p className={cn("text-[10px] text-muted-foreground ")}>
: {parsedData.billingDataMod.amount}/{parsedData.billingDataMod.cycle}
</p>
) : (
) : parsedData.billingDataMod.amount === "0" ? (
<p className={cn("text-[10px] text-green-600 ")}></p>
) : (
<p className={cn("text-[10px] text-pink-600 ")}></p>
)}
</>
))}
@ -202,12 +208,15 @@ export default function ServerCard({ now, serverInfo }: { now: number; serverInf
<p className={cn("text-[10px] text-muted-foreground")}>
: {isNeverExpire ? "永久" : daysLeft + "天"}
</p>
{parsedData.billingDataMod.amount !== "0" ? (
<p className={cn("text-[10px] text-muted-foreground")}>
{parsedData.billingDataMod.amount !== "0" &&
parsedData.billingDataMod.amount !== "-1" ? (
<p className={cn("text-[10px] text-muted-foreground ")}>
: {parsedData.billingDataMod.amount}/{parsedData.billingDataMod.cycle}
</p>
) : parsedData.billingDataMod.amount === "0" ? (
<p className={cn("text-[10px] text-green-600 ")}></p>
) : (
<p className={cn("text-[10px] text-green-600")}></p>
<p className={cn("text-[10px] text-pink-600 ")}></p>
)}
</>
) : (
@ -215,12 +224,15 @@ export default function ServerCard({ now, serverInfo }: { now: number; serverInf
<p className={cn("text-[10px] text-muted-foreground text-red-600")}>
: {daysLeft * -1}
</p>
{parsedData.billingDataMod.amount !== "0" ? (
{parsedData.billingDataMod.amount !== "0" &&
parsedData.billingDataMod.amount !== "-1" ? (
<p className={cn("text-[10px] text-muted-foreground ")}>
: {parsedData.billingDataMod.amount}/{parsedData.billingDataMod.cycle}
</p>
) : (
) : parsedData.billingDataMod.amount === "0" ? (
<p className={cn("text-[10px] text-green-600 ")}></p>
) : (
<p className={cn("text-[10px] text-pink-600 ")}></p>
)}
</>
))}

View File

@ -86,12 +86,15 @@ export default function ServerCardInline({
<p className={cn("text-[10px] text-muted-foreground")}>
: {isNeverExpire ? "永久" : daysLeft + "天"}
</p>
{parsedData.billingDataMod.amount !== "0" ? (
<p className={cn("text-[10px] text-muted-foreground")}>
{parsedData.billingDataMod.amount !== "0" &&
parsedData.billingDataMod.amount !== "-1" ? (
<p className={cn("text-[10px] text-muted-foreground ")}>
: {parsedData.billingDataMod.amount}/{parsedData.billingDataMod.cycle}
</p>
) : parsedData.billingDataMod.amount === "0" ? (
<p className={cn("text-[10px] text-green-600 ")}></p>
) : (
<p className={cn("text-[10px] text-green-600")}></p>
<p className={cn("text-[10px] text-pink-600 ")}></p>
)}
</>
) : (
@ -99,12 +102,15 @@ export default function ServerCardInline({
<p className={cn("text-[10px] text-muted-foreground text-red-600")}>
: {daysLeft * -1}
</p>
{parsedData.billingDataMod.amount !== "0" ? (
{parsedData.billingDataMod.amount !== "0" &&
parsedData.billingDataMod.amount !== "-1" ? (
<p className={cn("text-[10px] text-muted-foreground ")}>
: {parsedData.billingDataMod.amount}/{parsedData.billingDataMod.cycle}
</p>
) : (
) : parsedData.billingDataMod.amount === "0" ? (
<p className={cn("text-[10px] text-green-600 ")}></p>
) : (
<p className={cn("text-[10px] text-pink-600 ")}></p>
)}
</>
))}
@ -241,12 +247,15 @@ export default function ServerCardInline({
<p className={cn("text-[10px] text-muted-foreground")}>
: {isNeverExpire ? "永久" : daysLeft + "天"}
</p>
{parsedData.billingDataMod.amount !== "0" ? (
<p className={cn("text-[10px] text-muted-foreground")}>
{parsedData.billingDataMod.amount !== "0" &&
parsedData.billingDataMod.amount !== "-1" ? (
<p className={cn("text-[10px] text-muted-foreground ")}>
: {parsedData.billingDataMod.amount}/{parsedData.billingDataMod.cycle}
</p>
) : parsedData.billingDataMod.amount === "0" ? (
<p className={cn("text-[10px] text-green-600 ")}></p>
) : (
<p className={cn("text-[10px] text-green-600")}></p>
<p className={cn("text-[10px] text-pink-600 ")}></p>
)}
</>
) : (
@ -254,12 +263,15 @@ export default function ServerCardInline({
<p className={cn("text-[10px] text-muted-foreground text-red-600")}>
: {daysLeft * -1}
</p>
{parsedData.billingDataMod.amount !== "0" ? (
{parsedData.billingDataMod.amount !== "0" &&
parsedData.billingDataMod.amount !== "-1" ? (
<p className={cn("text-[10px] text-muted-foreground ")}>
: {parsedData.billingDataMod.amount}/{parsedData.billingDataMod.cycle}
</p>
) : (
) : parsedData.billingDataMod.amount === "0" ? (
<p className={cn("text-[10px] text-green-600 ")}></p>
) : (
<p className={cn("text-[10px] text-pink-600 ")}></p>
)}
</>
))}