event.stopPropagation()}>
+
+
+
+ {([
+ { key: 'create', label: '新建提醒' },
+ { key: 'existing', label: `已有提醒 ${pointRules.length}` },
+ ] as const).map(item => (
+
+ ))}
+
+
+ {tab === 'create' ? (
+
+
+
+
触发方向
+
+
+
+
+
+
+
+
+
+
+ 关键价位
+ {levelsQuery.isLoading && }
+
+
+ {([
+ { key: 'above', label: '上方', icon: ArrowUp, levels: recommended.above, color: 'text-bull' },
+ { key: 'below', label: '下方', icon: ArrowDown, levels: recommended.below, color: 'text-bear' },
+ ] as const).map(group => (
+
+
+ {group.label}
+
+
+ {group.levels.length === 0 ? (
+
暂无价位
+ ) : group.levels.map(level => {
+ const selected = Math.abs(Number(target) - level.value) < 0.005
+ return (
+
+ )
+ })}
+
+
+ ))}
+
+
+
+
+
+
+
+
+
+
+ {(alreadyReached || duplicate) && (
+
+ {duplicate ? '相同方向和价格的提醒已存在。' : '当前价格已处于触发区间,请调整目标价格或触发方向。'}
+
+ )}
+
+ ) : (
+
+ {rulesQuery.isLoading ? (
+
+ ) : pointRules.length === 0 ? (
+
+
+ 暂无点位提醒
+
+
+ ) : (
+
+ {pointRules.map(rule => {
+ const condition = pointCondition(rule)!
+ const isUp = condition.op === '>='
+ return (
+
+
+ {isUp ? : }
+
+
+ {rule.name}
+ {isUp ? '涨至' : '跌至'} {condition.value!.toFixed(2)} · {COOLDOWNS.find(item => item.value === rule.cooldown_seconds)?.label ?? `${rule.cooldown_seconds} 秒`}
+
+
+ {confirmDelete === rule.id ? (
+
+ ) : (
+
+ )}
+
+ )
+ })}
+
+ )}
+
+ )}
+
+
+