TypeScript 97.5%
SQL 1.4%
Python 0.8%
1"use client";2import * as React from "react";3import { authClient } from "@/lib/auth-client";4import { Button } from "@/components/ui/button";56export function ResendVerificationButton({ email, variant = "outline", size = "xs" }: { email: string; variant?: "outline" | "primary" | "secondary" | "link"; size?: "xs" | "sm" | "default" }) {7 const [state, setState] = React.useState<"idle" | "sending" | "sent" | "error">("idle");8 return (9 <Button10 variant={variant}11 size={size}12 loading={state === "sending"}13 disabled={state === "sent"}14 onClick={async () => {15 setState("sending");16 const { error } = await authClient.sendVerificationEmail({ email, callbackURL: "/dashboard?verified=1" });17 setState(error ? "error" : "sent");18 }}19 >20 {state === "sent" ? "Email sent" : state === "error" ? "Try again" : "Resend verification"}21 </Button>22 );23}24