import { Resend } from "resend";
import { env } from "@/lib/env";

let cachedClient: Resend | null = null;

export function isResendConfigured() {
  return Boolean(env.resendApiKey && env.resendFromEmail);
}

export function getResendClient() {
  if (!cachedClient) {
    cachedClient = new Resend(env.resendApiKey);
  }
  return cachedClient;
}
