diff --git a/app/(dashboard)/dashboard/calling/page.tsx b/app/(dashboard)/dashboard/calling/page.tsx index 8284045..88c49b4 100644 --- a/app/(dashboard)/dashboard/calling/page.tsx +++ b/app/(dashboard)/dashboard/calling/page.tsx @@ -5,9 +5,9 @@ import { db } from "@/lib/db" import { getCurrentUser } from "@/lib/session" import { EmptyPlaceholder } from "@/components/empty-placeholder" import { DashboardHeader } from "@/components/header" -import { PostCreateButton } from "@/components/post-create-button" import { PostItem } from "@/components/post-item" import { DashboardShell } from "@/components/shell" +import { CallCreateButton } from "@/components/call-create-button" export const metadata = { title: "Dashboard", @@ -38,20 +38,11 @@ export default async function DashboardPage() { return ( - +
- - - - No calls created - - You don't have any calls yet. - - - - +
) -} +} \ No newline at end of file diff --git a/components/call-create-button.tsx b/components/call-create-button.tsx new file mode 100644 index 0000000..07449e0 --- /dev/null +++ b/components/call-create-button.tsx @@ -0,0 +1,56 @@ +"use client" + +import * as React from "react" +import { useRouter } from "next/navigation" + +import { cn } from "@/lib/utils" +import { ButtonProps, buttonVariants } from "@/components/ui/button" +import { toast } from "@/components/ui/use-toast" +import { Icons } from "@/components/icons" + +interface CallCreateButtonProps extends ButtonProps {} + +export function CallCreateButton({ + className, + variant, + ...props +}: CallCreateButtonProps) { + const router = useRouter() + const [isLoading, setIsLoading] = React.useState(false) + // Function that returns a promise which resolves after the specified delay + const timeout = (ms: number): Promise => { + return new Promise(resolve => setTimeout(resolve, ms)); + } + async function onClick() { + setIsLoading(true) + + await timeout(1000); + + setIsLoading(false) + + + + } + + return ( + + ) +}