fix(global): server sort

This commit is contained in:
hamster1963 2024-12-10 00:38:35 +08:00
parent ea385ee699
commit d582027fcf

View File

@ -12,6 +12,10 @@ const MapTooltip = memo(function MapTooltip() {
if (!tooltipData) return null; if (!tooltipData) return null;
const sortedServers = tooltipData.servers.sort((a, b) => {
return a.status === b.status ? 0 : a.status ? 1 : -1;
});
return ( return (
<AnimatePresence mode="wait"> <AnimatePresence mode="wait">
<m.div <m.div
@ -46,7 +50,7 @@ const MapTooltip = memo(function MapTooltip() {
overflowY: "auto", overflowY: "auto",
}} }}
> >
{tooltipData.servers.map((server, index) => ( {sortedServers.map((server, index) => (
<div key={index} className="flex items-center gap-1.5 py-0.5"> <div key={index} className="flex items-center gap-1.5 py-0.5">
<span <span
className={`w-1.5 h-1.5 shrink-0 rounded-full ${ className={`w-1.5 h-1.5 shrink-0 rounded-full ${