hummingbird-me/kitsu-web

View on GitHub
app/components/episodes/streamer-plug.js

Summary

Maintainability
A
0 mins
Test Coverage
F
33%
import Component from '@ember/component';
import { get, computed } from '@ember/object';

// TODO: move this to the server's Streamer model
const STREAMING_LINKS = {
  hulu: {
    name: 'Hulu',
    link: 'https://www.hulu.com/start',
    description: 'More anime awaits, on Hulu.',
    cta: 'Start your free trial',
    logo: 'hulu-lg'
  }
};

export default Component.extend({
  classNames: ['streamer-plug'],
  classNameBindings: ['streamerClassName'],

  streamer: null,

  streamerClassName: computed('streamer', function () {
    return `${get(this, 'streamer')}-plug`;
  }),

  streamerInfo: computed('streamer', function () {
    return STREAMING_LINKS[get(this, 'streamer')];
  })
});