Skip to content

Commit

Permalink
Add loader
Browse files Browse the repository at this point in the history
  • Loading branch information
gramliu committed Dec 3, 2023
1 parent 17bc4e0 commit 2622b5c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion apps/agent/src/pipelines/canvas_to_page/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export default async function convertCanvasToPage({
maxTokens: 4096,
temperature: 0.1,
callbacks,
cache: false,
cache: true,
});
const response = await model.call(
[new SystemMessage(systemPrompt), humanMessage],
Expand Down
14 changes: 10 additions & 4 deletions apps/web/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ import {
} from "@ui/components";
import Canvas from "@ui/components/canvas";
import IconLabel from "@ui/components/icon-label";
import NextJsIcon from "@ui/icons/nextjs";
import clsx from "clsx";
import { GitBranchIcon, GithubIcon } from "lucide-react";
import { GitBranchIcon, GithubIcon, Loader2 } from "lucide-react";
import { useEffect, useReducer, useState } from "react";
import { CopyBlock, nord } from "react-code-blocks";
import { convertEditorToCode } from "~/lib/editorToCode";
Expand Down Expand Up @@ -108,7 +107,9 @@ export default function IndexPage() {
<div className="flex flex-row gap-2">
<Badge variant="secondary">{framework}</Badge>
{options.map((option) => (
<Badge variant="outline" key={`option_${option}`}>{option}</Badge>
<Badge variant="outline" key={`option_${option}`}>
{option}
</Badge>
))}
</div>
</div>
Expand Down Expand Up @@ -218,7 +219,12 @@ export default function IndexPage() {
}
}}
>
✨ Generate
{loading ? (
<Loader2 className="animate-spin mr-2" />
) : (
<span className="mr-2"></span>
)}{" "}
Generate
</Button>
</div>
<Toaster />
Expand Down

0 comments on commit 2622b5c

Please sign in to comment.