import { MarketOverview } from '@hanzo/ui'
The crypto preset, dark, 550px tall and as wide as its parent.
export function Default() {return <MarketOverview />}
Indices, futures, bonds and forex open as separate tabs in one table.
export function SeveralPresets() {return <MarketOverview tabs={["indices", "futures", "bonds", "forex"]} height={420} />}
A preset and a spelled-out watchlist sit side by side as tabs.
export function CustomTab() {return (<MarketOverview tabs={[ "crypto", { title: "Watchlist", symbols: [ { s: "NASDAQ:AAPL", d: "Apple" }, { s: "NASDAQ:MSFT", d: "Microsoft" }, ], }, ]} colorTheme="light" height={420} />)}
The open tab comes from state; a change opens the table afresh.
export function Controlled() {const presets = ["crypto", "indices", "forex"] as constconst [tab, setTab] = useState<(typeof presets)[number]>("crypto")return (<YStack gap="$3"><XStack gap="$2">{presets.map((p) => (<Button key={p} size="sm" variant={p === tab ? "primary" : "outline"} onPress={() => setTab(p)} >{p}</Button>))}</XStack><MarketOverview tabs={[tab]} height={380} /></YStack>)}
export interface MarketOverviewSymbol {/** Exchange-qualified ticker, e.g. `BINANCE:BTCUSDT`. */s: string/** The label shown in the row. */d: string}
export interface MarketOverviewTab {title: stringsymbols: MarketOverviewSymbol[]}
export type MarketOverviewPreset = 'crypto' | 'indices' | 'futures' | 'bonds' | 'forex'
export type MarketOverviewTheme = 'light' | 'dark'
export interface MarketOverviewProps extends Omit<YStackProps, 'width' | 'height' | 'theme'> {/** Which tabs the table opens with, a preset name or a spelled-out group. */tabs?: (MarketOverviewPreset | MarketOverviewTab)[]/** The table's own palette; independent of the surrounding gui theme. */colorTheme?: MarketOverviewTheme/** How far back the sparkline in each row reaches. */dateRange?: stringlocale?: stringisTransparent?: booleanshowFloatingTooltip?: booleanshowSymbolLogo?: booleanshowChart?: booleanwidth?: string | numberheight?: string | number}