import brand from "@/brand.config"; /** * BRAND constants — driven by brand.config.ts (white-label driven). */ export const BRAND = { name: brand.name, legalName: brand.legalName, tagline: brand.tagline, description: brand.description, domain: brand.domain, appUrl: brand.appUrl, email: { fromName: brand.emailFromName, // Composed, not configured. Keeping the mailbox and the domain as one // field is how a storefront ends up sending from a domain it does not own. fromAddress: `${brand.emailFromMailbox}@${brand.domain}`, }, support: { email: brand.supportEmail, whatsapp: brand.supportWhatsapp, sms: brand.supportWhatsapp, statusUrl: brand.supportUrl, hoursLocal: "24/7", responseTimeMinutes: 5, }, social: brand.social, } as const; export const GRADIENTS = { hero: "bg-gradient-to-br from-sand-50 via-white to-sand-100", heroText: "bg-clip-text text-transparent", card: "bg-gradient-to-br from-white to-sand-50", glow: "bg-gradient-to-r from-[var(--brand-accent)]/20 via-[var(--brand-accent)]/30 to-[var(--brand-accent-light)]/20", } as const; export type SupportChannel = "whatsapp" | "sms" | "email"; export interface SupportLinkContext { message?: string; orderId?: string; iccid?: string; skuName?: string; subject?: string; } export function buildSupportLink( channel: SupportChannel, context: SupportLinkContext = {}, ): string { const parts: string[] = []; if (context.message?.trim()) parts.push(context.message.trim()); if (context.orderId) parts.push(`Order: ${context.orderId}`); if (context.iccid) parts.push(`ICCID: ${context.iccid}`); if (context.skuName) parts.push(`Plan: ${context.skuName}`); const body = parts.join("\n"); if (channel === "whatsapp") { const digits = BRAND.support.whatsapp.replace(/\D/g, ""); return body ? `https://wa.me/${digits}?text=${encodeURIComponent(body)}` : `https://wa.me/${digits}`; } if (channel === "sms") { return body ? `sms:${BRAND.support.sms}?&body=${encodeURIComponent(body)}` : `sms:${BRAND.support.sms}`; } const subject = context.subject?.trim() || `${BRAND.name} support`; const qs = new URLSearchParams({ subject }); if (body) qs.set("body", body); return `mailto:${BRAND.support.email}?${qs.toString()}`; }