mhsf-dev/src/components/clerk/SignInPopoverButton.tsx
2024-08-03 09:51:45 -05:00

46 lines
1.3 KiB
TypeScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"use client";
import {
Popover,
PopoverContent,
PopoverTrigger,
} from "@/components/ui/popover";
import { Button } from "../ui/button";
import { AtSign, LogIn, UserCog } from "lucide-react";
import { useState } from "react";
import { SignIn, useClerk } from "@clerk/nextjs";
export default function SignInPopoverButton({
className,
variant
}: {
className?: string;
variant?: "default" | "destructive" | "secondary" | "outline" | "ghost" | "link";
}) {
const clerk = useClerk();
return (
<Popover>
<PopoverTrigger asChild>
<Button className={className} variant={variant}>Sign In</Button>
</PopoverTrigger>
<PopoverContent className="w-full">
<div className=" grid w-[200px]">
<strong className=" text-center">Login</strong>
<small className=" text-center">
Make comments about servers and favorite servers. Secured by Clerk
</small>
<br />
<Button variant={"ghost"} onClick={() => clerk.openSignIn()}>
<LogIn size={18} className="mr-2" />
Login
</Button>
<Button variant={"ghost"} onClick={() => clerk.openSignUp()}>
<AtSign size={18} className="mr-2" />
Sign-up
</Button>
</div>
</PopoverContent>
</Popover>
);
}