File tree Expand file tree Collapse file tree 10 files changed +395
-392
lines changed Expand file tree Collapse file tree 10 files changed +395
-392
lines changed Original file line number Diff line number Diff line change @@ -341,14 +341,16 @@ export default function Chat(props: Props) {
341
341
}
342
342
>
343
343
<div className="flex items-center space-x-2">
344
- <ModelSelector
345
- placeholder={t("model")}
346
- lng={lng}
347
- premium={hasGpt4Access()}
348
- avModels={avModels}
349
- model={model}
350
- setModel={setModel}
351
- />
344
+ <span>
345
+ <ModelSelector
346
+ placeholder={t("model")}
347
+ lng={lng}
348
+ premium={hasGpt4Access()}
349
+ avModels={avModels}
350
+ model={model}
351
+ setModel={setModel}
352
+ />
353
+ </span>
352
354
{messages.length === 1 && (
353
355
<Dialog>
354
356
<DialogTrigger>
Original file line number Diff line number Diff line change 1
1
import Chat from "./chat";
2
- import React from "react";
2
+ import React, { Suspense } from "react";
3
3
import type { Metadata } from "next";
4
4
import {
5
5
getUser,
9
9
} from "@/utils/supabase/queries";
10
10
import { createClient } from "@/utils/supabase/server";
11
11
import { DefaultLanguageParams } from "@/lib/languages";
12
+ import LoadingUI from "@/components/loading";
12
13
13
14
export const metadata: Metadata = {
14
15
title: "Chat",
@@ -63,6 +64,8 @@ export default async function ChatPage({
63
64
}
64
65
const q = await getQuotas();
65
66
return (
66
- <Chat subscriptions={subscriptions} user={user} lng={lng} quotas={q} />
67
+ <Suspense fallback={<LoadingUI />}>
68
+ <Chat subscriptions={subscriptions} user={user} lng={lng} quotas={q} />
69
+ </Suspense>
67
70
);
68
71
}
Original file line number Diff line number Diff line change 8
8
import Create from "./create";
9
9
import { createClient } from "@/utils/supabase/server";
10
10
import { DefaultLanguageParams } from "@/lib/languages";
11
+ import { Suspense } from "react";
12
+ import LoadingUI from "@/components/loading";
11
13
12
14
export default async function CreatePage({
13
15
params,
@@ -58,12 +60,14 @@ export default async function CreatePage({
58
60
}
59
61
const q = await getQuotas();
60
62
return (
61
- <Create
62
- products={products}
63
- subscriptions={subscriptions}
64
- user={user}
65
- lng={lng}
66
- quotas={q}
67
- />
63
+ <Suspense fallback={<LoadingUI />}>
64
+ <Create
65
+ products={products}
66
+ subscriptions={subscriptions}
67
+ user={user}
68
+ lng={lng}
69
+ quotas={q}
70
+ />
71
+ </Suspense>
68
72
);
69
73
}
Original file line number Diff line number Diff line change 1
1
"use client";
2
2
import { Suspense } from "react";
3
- import { Skeleton } from "@/components/ui/skeleton";
4
3
import GenerationEditPage from "./editpage";
5
4
import { DefaultLanguageParams } from "@/lib/languages";
5
+ import LoadingUI from "@/components/loading";
6
6
7
7
export default function ViewPage({
8
8
params,
9
9
}: {
10
10
params: DefaultLanguageParams;
11
11
}) {
12
12
return (
13
- <Suspense fallback={LoadingUI() }>
13
+ <Suspense fallback={< LoadingUI /> }>
14
14
<GenerationEditPage params={params} />
15
15
</Suspense>
16
16
);
17
17
}
18
- function LoadingUI() {
19
- return (
20
- <div className="flex h-screen w-screen flex-col items-center justify-center">
21
- <p>Loading...</p>
22
- <div className="space-y-2">
23
- <Skeleton className="h-4 w-[250px]" />
24
- <Skeleton className="h-4 w-[200px]" />
25
- <Skeleton className="h-16 w-[240px]" />
26
- </div>
27
- </div>
28
- );
29
- }
Original file line number Diff line number Diff line change 1
1
"use client";
2
2
import { Suspense } from "react";
3
- import { Skeleton } from "@/components/ui/skeleton";
4
3
import GenerationsPage from "./genpage";
5
4
import { DefaultLanguageParams } from "@/lib/languages";
5
+ import LoadingUI from "@/components/loading";
6
6
7
7
export default function ViewPage({
8
8
params,
9
9
}: {
10
10
params: DefaultLanguageParams;
11
11
}) {
12
12
return (
13
- <Suspense fallback={LoadingUI() }>
13
+ <Suspense fallback={< LoadingUI /> }>
14
14
<GenerationsPage params={params} />
15
15
</Suspense>
16
16
);
17
17
}
18
- function LoadingUI() {
19
- return (
20
- <div className="flex h-screen w-screen flex-col items-center justify-center">
21
- <p>Loading...</p>
22
- <div className="space-y-2">
23
- <Skeleton className="h-4 w-[250px]" />
24
- <Skeleton className="h-4 w-[200px]" />
25
- <Skeleton className="h-16 w-[240px]" />
26
- </div>
27
- </div>
28
- );
29
- }
Original file line number Diff line number Diff line change 1
1
"use client";
2
2
import { Suspense } from "react";
3
3
import GenerationViewPage from "./viewpage";
4
- import { Skeleton } from "@/components/ui/skeleton";
5
4
import { DefaultLanguageParams } from "@/lib/languages";
5
+ import LoadingUI from "@/components/loading";
6
6
7
7
export default function ViewPage({
8
8
params,
9
9
}: {
10
10
params: DefaultLanguageParams;
11
11
}) {
12
12
return (
13
- <Suspense fallback={LoadingUI() }>
13
+ <Suspense fallback={< LoadingUI /> }>
14
14
<GenerationViewPage params={params} />
15
15
</Suspense>
16
16
);
17
17
}
18
- function LoadingUI() {
19
- return (
20
- <div className="flex h-screen w-screen flex-col items-center justify-center">
21
- <p>Loading...</p>
22
- <div className="space-y-2">
23
- <Skeleton className="h-4 w-[250px]" />
24
- <Skeleton className="h-4 w-[200px]" />
25
- <Skeleton className="h-16 w-[240px]" />
26
- </div>
27
- </div>
28
- );
29
- }
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import MobileNavBar from "@/components/mobile-nav";
10
10
import { Toaster } from "@/components/ui/toaster";
11
11
import { Suspense, use } from "react";
12
12
import { DefaultLanguageParams } from "@/lib/languages";
13
+ import LoadingUI from "@/components/loading";
13
14
14
15
const manrope = Manrope({ subsets: ["latin"] });
15
16
export async function generateStaticParams() {
@@ -93,7 +94,7 @@ export default function RootLayout({
93
94
>
94
95
<ThemeProvider attribute="class" defaultTheme="system" enableSystem>
95
96
<NavBar lng={lng} />
96
- { children}
97
+ <Suspense fallback={<LoadingUI />}>{ children}</Suspense>
97
98
<MobileNavBar lng={lng} />
98
99
</ThemeProvider>
99
100
<Suspense>
You can’t perform that action at this time.
0 commit comments