aboutsummaryrefslogtreecommitdiff
path: root/src/components/chat_list/chat_list.vue
blob: 1248c4c8cc0a62444b3c4d2287bd9535f70157c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<template>
  <div v-if="isNew">
    <ChatNew @cancel="cancelNewChat" />
  </div>
  <div
    v-else
    class="chat-list panel panel-default"
  >
    <div class="panel-heading -sticky">
      <span class="title">
        {{ $t("chats.chats") }}
      </span>
      <button
        class="button-default"
        @click="newChat"
      >
        {{ $t("chats.new") }}
      </button>
    </div>
    <div class="panel-body">
      <div
        v-if="sortedChatList.length > 0"
        class="timeline"
      >
        <List :items="sortedChatList">
          <template #item="{item}">
            <ChatListItem
              :key="item.id"
              :compact="false"
              :chat="item"
            />
          </template>
        </List>
      </div>
      <div
        v-else
        class="emtpy-chat-list-alert"
      >
        <span>{{ $t('chats.empty_chat_list_placeholder') }}</span>
      </div>
    </div>
  </div>
</template>

<script src="./chat_list.js"></script>

<style lang="scss">
@import '../../_variables.scss';

.chat-list {
  min-height: 25em;
  margin-bottom: 0;
}

.emtpy-chat-list-alert {
  padding: 3em;
  font-size: 1.2em;
  display: flex;
  justify-content: center;
  color: $fallback--text;
  color: var(--faint, $fallback--text);
}

</style>