import QRCode from "qrcode";

export async function generateMonumentQR(subdomain: string): Promise<string> {
  const url = `https://${subdomain}.${process.env.NEXT_PUBLIC_APP_DOMAIN}`;
  const qrBuffer = await QRCode.toBuffer(url, {
    type: "png",
    width: 400,
    margin: 2,
    color: {
      dark: "#1a1a2e",
      light: "#ffffff",
    },
  });

  return `data:image/png;base64,${qrBuffer.toString("base64")}`;
}