summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/pages/projects/learn_gitlab/components/learn_gitlab_info_card.vue
blob: 3d2a8eed9d4ae48bf65519890b506b5d226dc3b9 (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
65
66
67
68
69
70
<script>
import { GlLink, GlCard, GlIcon } from '@gitlab/ui';
import { s__ } from '~/locale';

export default {
  name: 'LearnGitlabInfoCard',
  components: { GlLink, GlCard, GlIcon },
  i18n: {
    trial: s__('Learn GitLab|Trial only'),
  },
  props: {
    title: {
      required: true,
      type: String,
    },
    description: {
      required: true,
      type: String,
    },
    actionLabel: {
      required: true,
      type: String,
    },
    url: {
      required: true,
      type: String,
    },
    completed: {
      required: true,
      type: Boolean,
    },
    svg: {
      required: true,
      type: String,
    },
    trialRequired: {
      default: false,
      required: false,
      type: Boolean,
    },
  },
};
</script>
<template>
  <gl-card class="gl-pt-0">
    <div class="gl-text-right gl-h-5">
      <gl-icon
        v-if="completed"
        name="check-circle-filled"
        class="gl-text-green-500"
        :size="16"
        data-testid="completed-icon"
      />
      <span
        v-else-if="trialRequired"
        class="gl-text-gray-500 gl-font-sm gl-font-style-italic"
        data-testid="trial-only"
        >{{ $options.i18n.trial }}</span
      >
    </div>
    <div
      class="gl-text-center gl-display-flex gl-justify-content-center gl-align-items-center gl-flex-direction-column learn-gitlab-info-card-content"
    >
      <img :src="svg" />
      <h6>{{ title }}</h6>
      <p class="gl-font-sm gl-text-gray-700">{{ description }}</p>
      <gl-link :href="url" target="_blank">{{ actionLabel }}</gl-link>
    </div>
  </gl-card>
</template>