summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/ide/components/commit_sidebar/empty_state.vue
blob: ed12b5373b4a025d70c718850977f02aa7652769 (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
<script>
import { mapState } from 'vuex';
import Icon from '~/vue_shared/components/icon.vue';
import tooltip from '~/vue_shared/directives/tooltip';

export default {
  components: {
    Icon,
  },
  directives: {
    tooltip,
  },
  computed: {
    ...mapState(['lastCommitMsg', 'noChangesStateSvgPath', 'committedStateSvgPath']),
    statusSvg() {
      return this.lastCommitMsg ? this.committedStateSvgPath : this.noChangesStateSvgPath;
    },
  },
};
</script>

<template>
  <div
    class="multi-file-commit-panel-section ide-commit-empty-state js-empty-state"
  >
    <div
      class="ide-commit-empty-state-container"
    >
      <div class="svg-content svg-80">
        <img :src="statusSvg" />
      </div>
      <div class="append-right-default prepend-left-default">
        <div
          class="text-content text-center"
          v-if="!lastCommitMsg"
        >
          <h4>
            {{ __('No changes') }}
          </h4>
          <p>
            {{ __('Edit files in the editor and commit changes here') }}
          </p>
        </div>
        <div
          class="text-content text-center"
          v-else
        >
          <h4>
            {{ __('All changes are committed') }}
          </h4>
          <p v-html="lastCommitMsg"></p>
        </div>
      </div>
    </div>
  </div>
</template>