From 49379b11b8dfa179fd81398e8b4b5423c7275038 Mon Sep 17 00:00:00 2001
From: jdlugosz963 <jdlugosz963@gmail.com>
Date: Wed, 15 Dec 2021 14:53:33 +0100
Subject: add Groups View and message fetcher

---
 src/components/group/Message.vue | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 src/components/group/Message.vue

(limited to 'src/components/group/Message.vue')

diff --git a/src/components/group/Message.vue b/src/components/group/Message.vue
new file mode 100644
index 0000000..56e2805
--- /dev/null
+++ b/src/components/group/Message.vue
@@ -0,0 +1,35 @@
+<template>
+  <div class="message">
+      <div class="sender">{{ get_message_user }}</div>
+      <div class="content">{{ get_message_content }}</div>
+      <div class="date">{{ get_message_date }}</div>
+  </div>
+</template>
+
+<script>
+export default {
+  props: {
+    message: Object
+  },
+
+  computed: {
+    get_message_user() { return this.message.sender.username },
+    get_message_content() { return this.message.message },
+    get_message_date() {
+      let date = new Date(this.message.create_date)
+      return `${date.getDate()}/${date.getMonth()} ${date.getHours()}:${date.getMinutes()}`
+    },
+  },
+
+  created() {
+    this.$nextTick(function () {
+    })
+  }
+}
+</script>
+
+<style scoped>
+.message {
+  width: 100%;
+}
+</style>
-- 
cgit v1.2.3

