Skip to content

Commit

Permalink
Show publish button only for admin
Browse files Browse the repository at this point in the history
  • Loading branch information
delasy committed Oct 18, 2024
1 parent 9fb0d90 commit 972bb99
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
22 changes: 12 additions & 10 deletions app/playground/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,16 +149,18 @@ export default function PlaygroundPage() {
</div>
<p className="text-xs">* Click on a cell to place entity</p>
</div>
<Button
className="gap-1"
disabled={publishing}
onClick={handlePublish}
type="button"
variant="destructive"
>
<CircleAlertIcon size={16} />
<span>{publishing ? "Publishing..." : "Publish Map"}</span>
</Button>
{isAdmin && (
<Button
className="gap-1"
disabled={publishing}
onClick={handlePublish}
type="button"
variant="destructive"
>
<CircleAlertIcon size={16} />
<span>{publishing ? "Publishing..." : "Publish Map"}</span>
</Button>
)}
</div>
<div
className={`flex justify-center ${visualizing ? "pt-[28px]" : ""}`}
Expand Down
2 changes: 1 addition & 1 deletion models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { gemini15pro } from "./gemini-1.5-pro";
import { gpt4o } from "./gpt-4o";
import { claude35sonnet } from "./claude-3-5-sonnet";
import { perplexityModel } from "./perplexity-llama";
import { errorMessage } from "@/lib/utils";
import { errorMessage } from "../lib/utils";

export type ModelHandler = (
prompt: string,
Expand Down

0 comments on commit 972bb99

Please sign in to comment.