import { Link, Section, Text } from '@react-email/components' import { baseStyles, colors, typography } from '@/components/emails/_styles' import { proFeatures } from '@/components/emails/billing/constants' import { EmailLayout } from '@/components/emails/components' import { dollarsToCredits } from '@/lib/billing/credits/conversion' import { getBrandConfig } from '@/ee/whitelabeling' interface CreditsExhaustedEmailProps { userName?: string limit: number upgradeLink: string } export function CreditsExhaustedEmail({ userName, limit, upgradeLink, }: CreditsExhaustedEmailProps) { const brand = getBrandConfig() return ( {userName ? `Hi ${userName},` : 'Hi,'} You've used all {dollarsToCredits(limit).toLocaleString()} of your free credits on {brand.name}. Your workflows are paused until you upgrade.
Pro includes {proFeatures.map((feature, i) => ( ))}
{feature.label} {feature.desc}
Upgrade to Pro
One-time notification when free credits are exhausted. ) } export default CreditsExhaustedEmail