aboutsummaryrefslogtreecommitdiff
path: root/lib/components/status.js
diff options
context:
space:
mode:
authorBen Beltran <ben@nsovocal.com>2017-08-30 00:29:19 -0500
committerBen Beltran <ben@nsovocal.com>2017-08-30 00:29:19 -0500
commitb78f678de4f242b2a364bbf0cc39c8ec61ee5357 (patch)
tree92cb79b266ec9b5b609a8e8ba829bda3d7315ca8 /lib/components/status.js
parentdc7f608a828fc0b34a291af915727ab1f7d6ba0a (diff)
parent21f11b5ae525f52fd1a2bf1a741ad79bfccb1278 (diff)
Merge branch 'release/1.0.0'HEADmain
Diffstat (limited to 'lib/components/status.js')
-rw-r--r--lib/components/status.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/components/status.js b/lib/components/status.js
new file mode 100644
index 0000000..0f79788
--- /dev/null
+++ b/lib/components/status.js
@@ -0,0 +1,22 @@
+import Vue from 'vue';
+import DataService from '../services/data';
+
+const internals = {};
+
+/**
+ * The status class, renders the winner during the poll stage, and a
+ * message while waiting
+ *
+ * @class StatusComponent
+ */
+export default Vue.component('status', {
+ template: '<div class="status-widget">' +
+ '<transition name="fade">' +
+ '<div v-if="state === 0" class="waiting-message">Waiting</div>' +
+ '<div v-if="state === 2 && !winner" class="no-winner">Could not read you</div>' +
+ '<div v-if="state === 2 && winner" class="winner" v-bind:class="[winner]">{{winner}}</div>' +
+ '</transition>' +
+ '</div>',
+
+ data: DataService.data
+});