feat: add share page settings dialog + add org id to deployment as well

This commit is contained in:
BennyKok
2024-01-20 12:06:26 +08:00
parent a2d0e93172
commit 163e6f0426
32 changed files with 2396 additions and 253 deletions
+10
View File
@@ -9,6 +9,7 @@ import {
DropdownMenuItem,
DropdownMenuTrigger,
} from "@/components/ui/dropdown-menu";
import { useAuth, useClerk } from "@clerk/nextjs";
import { MoreVertical } from "lucide-react";
import { useRouter } from "next/navigation";
import { useState } from "react";
@@ -49,7 +50,9 @@ export function ButtonActionMenu(props: {
action: () => Promise<any>;
}[];
}) {
const user = useAuth();
const [isLoading, setIsLoading] = useState(false);
const clerk = useClerk();
return (
<DropdownMenu>
@@ -64,6 +67,13 @@ export function ButtonActionMenu(props: {
<DropdownMenuItem
key={action.title}
onClick={async () => {
if (!user.isSignedIn) {
clerk.openSignIn({
redirectUrl: window.location.href,
});
return;
}
setIsLoading(true);
await callServerPromise(action.action());
setIsLoading(false);