1
- import {
2
- defineMetabaseAuthConfig ,
3
- MetabaseProvider ,
4
- defineMetabaseTheme ,
5
- } from "@metabase/embedding-sdk-react/nextjs" ;
6
1
import type { Metadata } from "next" ;
7
2
8
3
import localFont from "next/font/local" ;
9
4
import "./globals.css" ;
10
5
import Link from "next/link" ;
11
-
12
- if ( ! process . env . NEXT_PUBLIC_METABASE_INSTANCE_URL ) {
13
- throw new Error ( "Missing NEXT_PUBLIC_METABASE_INSTANCE_URL" ) ;
14
- }
6
+ import { AppProvider } from '@/app/app-provider' ;
7
+ import { Suspense } from 'react' ;
15
8
16
9
const geistSans = localFont ( {
17
10
src : "./fonts/GeistVF.woff" ,
@@ -29,52 +22,6 @@ export const metadata: Metadata = {
29
22
description : "Generated by create next app" ,
30
23
} ;
31
24
32
- const authConfig = defineMetabaseAuthConfig ( {
33
- metabaseInstanceUrl : process . env . NEXT_PUBLIC_METABASE_INSTANCE_URL ,
34
- authProviderUri : `/api/metabase/auth` ,
35
- } ) ;
36
-
37
- const theme = defineMetabaseTheme ( {
38
- // Specify a font to use from the set of fonts supported by Metabase.
39
- // You can set the font to "Custom" to use the custom font
40
- // configured in your Metabase instance.
41
- fontFamily : "Lato" ,
42
-
43
- // Override the base font size for every component.
44
- // This does not usually need to be set, as the components
45
- // inherit the font size from the parent container, such as the body.
46
- fontSize : "16px" ,
47
-
48
- // Override the base line height for every component.
49
- lineHeight : 1.5 ,
50
-
51
- // Match your application's color scheme
52
- colors : {
53
- brand : "#6b88bd" ,
54
- "text-primary" : "#FFFFFF" ,
55
- "text-secondary" : "#B0BEC5" ,
56
- "text-tertiary" : "#78909C" ,
57
- background : "#181A1B" ,
58
- "background-hover" : "#23272B" ,
59
- border : "#263238" ,
60
- filter : "#939393" ,
61
- summarize : "#5e749c" ,
62
- shadow : "rgba(0,0,0,0.6)" ,
63
- } ,
64
-
65
- components : {
66
- question : {
67
- backgroundColor : "#23272B" ,
68
- } ,
69
- table : {
70
- cell : {
71
- textColor : "#FFFFFF" ,
72
- backgroundColor : "#181A1B" ,
73
- } ,
74
- } ,
75
- } ,
76
- } ) ;
77
-
78
25
export default function RootLayout ( {
79
26
children,
80
27
} : Readonly < {
@@ -95,7 +42,9 @@ export default function RootLayout({
95
42
< Link href = "/static-dashboard" > Static Dashboard</ Link >
96
43
< Link href = "/interactive-dashboard" > Interactive Dashboard</ Link >
97
44
</ nav >
98
- < MetabaseProvider authConfig = { authConfig } theme = { theme } > { children } </ MetabaseProvider >
45
+ < Suspense >
46
+ < AppProvider > { children } </ AppProvider >
47
+ </ Suspense >
99
48
</ body >
100
49
</ html >
101
50
) ;
0 commit comments