feat: added deploy button

This commit is contained in:
Akhilesh Rangani 2024-07-17 11:30:45 -04:00
parent 2163b1dfb7
commit 478a332a2e
2 changed files with 36 additions and 4 deletions

View File

@ -0,0 +1,28 @@
"use client";
import { useState } from "react";
import { Button } from "@/components/ui/button";
import { Play, Pause } from "lucide-react";
export default function DeployButtonModal() {
const [isDeploying, setIsDeploying] = useState(false);
const handleDeploy = () => {
if (isDeploying) {
console.log("Stopping deployment...");
} else {
console.log("Starting deployment...");
}
setIsDeploying(!isDeploying);
};
return (
<>
<Button variant="outline" onClick={handleDeploy}>
{isDeploying ? <Pause className="w-4 h-4 mr-2" /> : <Play className="w-4 h-4 mr-2" />}
{isDeploying ? "Deployed" : "Deploy"}
</Button>
</>
);
}

View File

@ -11,6 +11,7 @@ import { useState } from "react";
import EditSandboxModal from "./edit"; import EditSandboxModal from "./edit";
import ShareSandboxModal from "./share"; import ShareSandboxModal from "./share";
import { Avatars } from "../live/avatars"; import { Avatars } from "../live/avatars";
import DeployButtonModal from "./deploy";
export default function Navbar({ export default function Navbar({
userData, userData,
@ -66,10 +67,13 @@ export default function Navbar({
<Avatars /> <Avatars />
{isOwner ? ( {isOwner ? (
<>
<DeployButtonModal />
<Button variant="outline" onClick={() => setIsShareOpen(true)}> <Button variant="outline" onClick={() => setIsShareOpen(true)}>
<Users className="w-4 h-4 mr-2" /> <Users className="w-4 h-4 mr-2" />
Share Share
</Button> </Button>
</>
) : null} ) : null}
<UserButton userData={userData} /> <UserButton userData={userData} />
</div> </div>