mirror of
https://github.com/Buriburizaem0n/nezha-dash-v1.git
synced 2026-05-06 13:58:43 +00:00
refactor: simplify network route handling in PlanInfo component
This commit is contained in:
@@ -15,6 +15,9 @@ export default function PlanInfo({
|
|||||||
: parsedData.planDataMod.extra.split(",")[0] === ""
|
: parsedData.planDataMod.extra.split(",")[0] === ""
|
||||||
? []
|
? []
|
||||||
: [parsedData.planDataMod.extra];
|
: [parsedData.planDataMod.extra];
|
||||||
|
const networkRoutes = parsedData.planDataMod.networkRoute
|
||||||
|
? parsedData.planDataMod.networkRoute.split(",")
|
||||||
|
: [];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<section className="flex gap-1 items-center flex-wrap mt-0.5">
|
<section className="flex gap-1 items-center flex-wrap mt-0.5">
|
||||||
@@ -60,17 +63,9 @@ export default function PlanInfo({
|
|||||||
"text-[9px] bg-blue-600 text-blue-200 dark:bg-blue-800 dark:text-blue-300 w-fit rounded-[5px] px-[3px] py-[1.5px]",
|
"text-[9px] bg-blue-600 text-blue-200 dark:bg-blue-800 dark:text-blue-300 w-fit rounded-[5px] px-[3px] py-[1.5px]",
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
{parsedData.planDataMod.networkRoute
|
{networkRoutes.map((route, index) => {
|
||||||
.split(",")
|
return route + (index === networkRoutes.length - 1 ? "" : "|");
|
||||||
.map((route, index) => {
|
})}
|
||||||
return (
|
|
||||||
route +
|
|
||||||
(index ===
|
|
||||||
parsedData.planDataMod?.networkRoute.split(",").length - 1
|
|
||||||
? ""
|
|
||||||
: "|")
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
</p>
|
</p>
|
||||||
)}
|
)}
|
||||||
{extraList.map((extra, index) => {
|
{extraList.map((extra, index) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user