mirror of
https://github.com/hanzoai/ui.git
synced 2026-11-21 00:18:41 +00:00
React.lazy expects default exports, but all finance registry files were using named exports. This caused build failures with the error: "Element type is invalid: expected a string ... but got: undefined" Changes: - Updated all finance registry files to import and re-export as default - Removed non-existent mini-chart and symbol-overview MDX files - Updated sidebar navigation to remove mini-chart and symbol-overview - Fixed market-overview, ticker-tape, and trading-panel registry files The finance components now properly load in ComponentPreview during static site generation.
35 lines
966 B
TypeScript
35 lines
966 B
TypeScript
"use client"
|
|
|
|
import "@rainbow-me/rainbowkit/styles.css"
|
|
|
|
import { useEffect, useState, type ReactNode } from "react"
|
|
import { RainbowKitProvider } from "@rainbow-me/rainbowkit"
|
|
import { QueryClient, QueryClientProvider } from "@tanstack/react-query"
|
|
import { WagmiProvider, type Config } from "wagmi"
|
|
|
|
const queryClient = new QueryClient()
|
|
|
|
export function Web3Provider({ children }: { children: ReactNode }) {
|
|
const [config, setConfig] = useState<Config | null>(null)
|
|
|
|
useEffect(() => {
|
|
// Dynamically import wagmi config only on client side
|
|
import("@/lib/wagmi").then((mod) => {
|
|
setConfig(mod.getConfig())
|
|
})
|
|
}, [])
|
|
|
|
// Don't render until config is loaded
|
|
if (!config) {
|
|
return <>{children}</>
|
|
}
|
|
|
|
return (
|
|
<WagmiProvider config={config}>
|
|
<QueryClientProvider client={queryClient}>
|
|
<RainbowKitProvider modalSize="compact">{children}</RainbowKitProvider>
|
|
</QueryClientProvider>
|
|
</WagmiProvider>
|
|
)
|
|
}
|