summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/issues/list/components/empty_state_with_any_issues.vue
blob: 8aece24de0c5a8e42c95c084c4f7b8800713f006 (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
<script>
import { GlButton, GlEmptyState } from '@gitlab/ui';
import { i18n } from '../constants';

export default {
  i18n,
  components: {
    GlButton,
    GlEmptyState,
  },
  inject: ['emptyStateSvgPath', 'newIssuePath', 'showNewIssueLink'],
  props: {
    hasSearch: {
      type: Boolean,
      required: true,
    },
    isOpenTab: {
      type: Boolean,
      required: true,
    },
  },
};
</script>

<template>
  <gl-empty-state
    v-if="hasSearch"
    :description="$options.i18n.noSearchResultsDescription"
    :title="$options.i18n.noSearchResultsTitle"
    :svg-path="emptyStateSvgPath"
  >
    <template #actions>
      <gl-button v-if="showNewIssueLink" :href="newIssuePath" variant="confirm">
        {{ $options.i18n.newIssueLabel }}
      </gl-button>
    </template>
  </gl-empty-state>

  <gl-empty-state
    v-else-if="isOpenTab"
    :description="$options.i18n.noOpenIssuesDescription"
    :title="$options.i18n.noOpenIssuesTitle"
    :svg-path="emptyStateSvgPath"
  >
    <template #actions>
      <gl-button v-if="showNewIssueLink" :href="newIssuePath" variant="confirm">
        {{ $options.i18n.newIssueLabel }}
      </gl-button>
    </template>
  </gl-empty-state>

  <gl-empty-state v-else :title="$options.i18n.noClosedIssuesTitle" :svg-path="emptyStateSvgPath" />
</template>