summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/clusters_list/components/agent_empty_state.vue
blob: f54f7b114144e74e24cc793742f8485f0dadef79 (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
<script>
import { GlButton, GlEmptyState, GlLink, GlSprintf, GlModalDirective } from '@gitlab/ui';
import { helpPagePath } from '~/helpers/help_page_helper';
import { INSTALL_AGENT_MODAL_ID, I18N_AGENTS_EMPTY_STATE } from '../constants';

export default {
  i18n: I18N_AGENTS_EMPTY_STATE,
  modalId: INSTALL_AGENT_MODAL_ID,
  agentDocsUrl: helpPagePath('user/clusters/agent/index'),
  components: {
    GlButton,
    GlEmptyState,
    GlLink,
    GlSprintf,
  },
  directives: {
    GlModalDirective,
  },
  inject: ['emptyStateImage'],
  props: {
    isChildComponent: {
      default: false,
      required: false,
      type: Boolean,
    },
  },
};
</script>

<template>
  <gl-empty-state :svg-path="emptyStateImage" title="" class="agents-empty-state">
    <template #description>
      <p class="gl-text-left">
        <gl-sprintf :message="$options.i18n.introText">
          <template #link="{ content }">
            <gl-link :href="$options.agentDocsUrl">
              {{ content }}
            </gl-link>
          </template>
        </gl-sprintf>
      </p>
    </template>

    <template #actions>
      <gl-button
        v-if="!isChildComponent"
        v-gl-modal-directive="$options.modalId"
        category="primary"
        variant="confirm"
      >
        {{ $options.i18n.buttonText }}
      </gl-button>
    </template>
  </gl-empty-state>
</template>