import Ember from 'ember';

export function popularity([target, minimum, maximum]) {
    var classname = ['not-popular', 'popular', 'very-popular'];
    var interval = ( maximum + 1 - minimum ) / classname.length;

    var i = Math.floor((target-minimum)/interval);

    return classname[i];
}

export default Ember.Helper.helper(popularity);
