summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/ide/components/changed_file_icon.vue
blob: 0c54c992e51e076d55ab8fc1edbd3029ed81cce0 (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
<script>
  import icon from '~/vue_shared/components/icon.vue';

  export default {
    components: {
      icon,
    },
    props: {
      file: {
        type: Object,
        required: true,
      },
    },
    computed: {
      changedIcon() {
        return this.file.tempFile ? 'file-addition' : 'file-modified';
      },
      changedIconClass() {
        return `multi-${this.changedIcon}`;
      },
    },
  };
</script>

<template>
  <icon
    :name="changedIcon"
    :size="12"
    :css-classes="`ide-file-changed-icon ${changedIconClass}`"
  />
</template>