mirror of
https://github.com/GlueOps/autoglue.git
synced 2026-02-13 12:50:05 +01:00
feat: sdk migration in progress
This commit is contained in:
18
ui/src/providers/index.tsx
Normal file
18
ui/src/providers/index.tsx
Normal file
@@ -0,0 +1,18 @@
|
||||
import type { ReactNode } from "react"
|
||||
import { ThemeProvider } from "@/providers/theme-provider.tsx"
|
||||
import { QueryClient, QueryClientProvider } from "@tanstack/react-query"
|
||||
|
||||
import { Toaster } from "@/components/ui/sonner.tsx"
|
||||
|
||||
const queryClient = new QueryClient()
|
||||
|
||||
export const Providers = ({ children }: { children: ReactNode }) => {
|
||||
return (
|
||||
<QueryClientProvider client={queryClient}>
|
||||
<ThemeProvider defaultTheme="system" storageKey="dragon-theme">
|
||||
{children}
|
||||
<Toaster richColors expand position="top-center" />
|
||||
</ThemeProvider>
|
||||
</QueryClientProvider>
|
||||
)
|
||||
}
|
||||
26
ui/src/providers/theme-provider.tsx
Normal file
26
ui/src/providers/theme-provider.tsx
Normal file
@@ -0,0 +1,26 @@
|
||||
import type { ReactNode } from "react"
|
||||
import { ThemeProvider as NextThemesProvider } from "next-themes"
|
||||
|
||||
export type Theme = "light" | "dark" | "system"
|
||||
|
||||
export function ThemeProvider({
|
||||
children,
|
||||
defaultTheme = "system",
|
||||
storageKey = "vite-ui-theme",
|
||||
}: {
|
||||
children: ReactNode
|
||||
defaultTheme?: Theme
|
||||
storageKey?: string
|
||||
}) {
|
||||
return (
|
||||
<NextThemesProvider
|
||||
attribute="class"
|
||||
defaultTheme={defaultTheme}
|
||||
enableSystem
|
||||
storageKey={storageKey}
|
||||
disableTransitionOnChange
|
||||
>
|
||||
{children}
|
||||
</NextThemesProvider>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user