移除天气市场新闻面板,市场列支持点击跳转 Polymarket

删除 WeatherNewsPanel 组件。GroupedMarketTable 市场价格列支持 ExternalLink 跳转到 Polymarket。城市数据去重,每城只保留排名最高的合约。
This commit is contained in:
2569718930@qq.com
2026-05-25 04:25:22 +08:00
parent baede6a485
commit 52ca7d3efa
3 changed files with 27 additions and 7 deletions
@@ -886,8 +886,17 @@ function PolyWeatherTerminal({
}, [isEn]);
const filteredRegionRows = useMemo(() => {
if (selectedRegionKey === "all") return rows;
return rows.filter((row) => String(row.trading_region).toLowerCase() === selectedRegionKey);
const byRegion = selectedRegionKey === "all"
? rows
: rows.filter((row) => String(row.trading_region).toLowerCase() === selectedRegionKey);
// Deduplicate: one row per city, keep the first (highest score from sorting)
const seen = new Set<string>();
return byRegion.filter((row) => {
const key = (row.city || "").toLowerCase();
if (seen.has(key)) return false;
seen.add(key);
return true;
});
}, [rows, selectedRegionKey]);
const watchRows = useMemo(() => {
@@ -2,7 +2,7 @@
import { Fragment, useState } from "react";
import clsx from "clsx";
import { ChevronDown, ChevronRight } from "lucide-react";
import { ChevronDown, ChevronRight, ExternalLink } from "lucide-react";
import type { ScanOpportunityRow } from "@/lib/dashboard-types";
import {
type ContinentGroup,
@@ -125,7 +125,21 @@ export function GroupedMarketTable({
{temp(row.signed_gap ?? row.gap_to_target, row.temp_symbol)}
</td>
<td className="px-2 py-1.5 text-right font-mono">
{formatPrice(row.midpoint, row.ask, row.bid)}
{row.market_url ? (
<a
href={row.market_url}
target="_blank"
rel="noopener noreferrer"
onClick={(e) => e.stopPropagation()}
className="inline-flex items-center gap-0.5 text-blue-600 hover:text-blue-800 hover:underline"
title={row.market_question || "Polymarket"}
>
{formatPrice(row.midpoint, row.ask, row.bid)}
<ExternalLink size={10} />
</a>
) : (
formatPrice(row.midpoint, row.ask, row.bid)
)}
</td>
<td className={clsx("px-2 py-1.5 text-right font-mono font-bold", edgeClass(row.edge_percent))}>
{pct(row.edge_percent)}
@@ -27,9 +27,6 @@ export function Panel({
</h2>
<div className="flex items-center gap-1.5">
{actions}
<span className="grid h-5 w-5 cursor-pointer place-items-center rounded border border-slate-300 bg-white text-[9px] text-slate-500 hover:bg-slate-50">
</span>
</div>
</div>
<div className="flex-1 min-h-0 overflow-auto">