export function getDecayInfo(createdAt, lastEchoAt) {
    const now = Date.now();
    const echoTime = lastEchoAt?.toMillis() ?? createdAt.toMillis();
    const createdTime = createdAt.toMillis(); 

    const daysSinceCreated = Math.floor((now - createdTime) / (1000 * 60 * 60 * 24));
    const daysSinceEcho = Math.floor((now - echoTime)/(1000 * 60 * 60 * 24));
    const daysLeft = 30 - daysSinceEcho;

    return {
        daysAgo: daysSinceCreated,
        daysLeft: Math.max(0, daysLeft),
        isExpired: daysLeft <= 0
    };
}