Fix: Address Copilot review (use slice for suffix removal, remove unused import)
This commit is contained in:
parent
960044eb2d
commit
c227679ccf
|
|
@ -1,7 +1,5 @@
|
||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import React, { useEffect, useRef, memo } from 'react';
|
|
||||||
import { useTheme } from "next-themes";
|
|
||||||
import { formatSymbolForTradingView } from '@/lib/utils';
|
import { formatSymbolForTradingView } from '@/lib/utils';
|
||||||
|
|
||||||
interface TradingViewWatchlistProps {
|
interface TradingViewWatchlistProps {
|
||||||
|
|
|
||||||
|
|
@ -160,17 +160,17 @@ export function formatSymbolForTradingView(symbol: string): string {
|
||||||
|
|
||||||
// Shanghai
|
// Shanghai
|
||||||
if (upperSymbol.endsWith('.SS')) {
|
if (upperSymbol.endsWith('.SS')) {
|
||||||
return `SSE:${upperSymbol.replace('.SS', '')}`;
|
return `SSE:${upperSymbol.slice(0, -3)}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Shenzhen
|
// Shenzhen
|
||||||
if (upperSymbol.endsWith('.SZ')) {
|
if (upperSymbol.endsWith('.SZ')) {
|
||||||
return `SZSE:${upperSymbol.replace('.SZ', '')}`;
|
return `SZSE:${upperSymbol.slice(0, -3)}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Hong Kong
|
// Hong Kong
|
||||||
if (upperSymbol.endsWith('.HK')) {
|
if (upperSymbol.endsWith('.HK')) {
|
||||||
return `HKEX:${upperSymbol.replace('.HK', '')}`;
|
return `HKEX:${upperSymbol.slice(0, -3)}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
return upperSymbol;
|
return upperSymbol;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue