confirm.stories.js 700 B

123456789101112131415161718192021222324252627282930
  1. import Button from 'sentry/components/button';
  2. import Confirm from 'sentry/components/confirm';
  3. // TODO(scttcper): modal not working
  4. export default {
  5. title: 'Components/Buttons/Confirm',
  6. component: Confirm,
  7. args: {
  8. message: 'Are you sure you want to do this?',
  9. },
  10. argTypes: {
  11. onConfirm: {action: 'confirmed'},
  12. },
  13. };
  14. export const _Confirm = ({...args}) => (
  15. <div>
  16. <Confirm {...args}>
  17. <Button priority="primary">Confirm on Button click</Button>
  18. </Confirm>
  19. </div>
  20. );
  21. _Confirm.parameters = {
  22. docs: {
  23. description: {
  24. story:
  25. 'Component whose child is rendered as the "action" component that when clicked opens the "Confirm Modal"',
  26. },
  27. },
  28. };