// Avatar variable injection system

interface Avatar {
    id: string;
    persona_name: string;
    pain_points?: string;
    desires?: string;
    [key: string]: any;
}

export function injectAvatarVariables(content: string, avatar: Avatar | null): string {
    if (!avatar || !content) return content;
    return content.replace(/\{\{avatar\.(\w+)\}\}/g, (match, fieldName) => {
        return avatar[fieldName] || match;
    });
}
