summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/vue_shared/components/confirm_danger/confirm_danger_modal.stories.js
blob: 6629b293eb93b9dd19d620d6063e902540201b02 (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
/* eslint-disable @gitlab/require-i18n-strings */
import ConfirmDanger from './confirm_danger.vue';

export default {
  component: ConfirmDanger,
  title: 'vue_shared/components/modals/confirm_danger_modal',
};

const Template = (args, { argTypes }) => ({
  components: { ConfirmDanger },
  props: Object.keys(argTypes),
  template: '<confirm-danger v-bind="$props" />',
  provide: {
    additionalInformation: args.additionalInformation || null,
    confirmDangerMessage: args.confirmDangerMessage || 'You require more Vespene Gas',
    htmlConfirmationMessage: args.confirmDangerMessage || false,
  },
});

export const Default = Template.bind({});
Default.args = {
  phrase: 'You must construct additional pylons',
  buttonText: 'Confirm button text',
};

export const Disabled = Template.bind({});
Disabled.args = {
  ...Default.args,
  disabled: true,
};

export const AdditionalInformation = Template.bind({});
AdditionalInformation.args = {
  ...Default.args,
  additionalInformation: 'This replaces the default warning information',
};

export const HtmlMessage = Template.bind({});
HtmlMessage.args = {
  ...Default.args,
  confirmDangerMessage: 'You strongly require more <strong>Vespene Gas</strong>',
  htmlConfirmationMessage: true,
};