/* eslint-disable no-console */ import {Fragment, useState} from 'react'; import styled from '@emotion/styled'; import {Button} from 'sentry/components/button'; import Confirm, {openConfirmModal} from 'sentry/components/confirm'; import Link from 'sentry/components/links/link'; import JSXNode from 'sentry/components/stories/jsxNode'; import JSXProperty from 'sentry/components/stories/jsxProperty'; import Matrix from 'sentry/components/stories/matrix'; import SideBySide from 'sentry/components/stories/sideBySide'; import storyBook from 'sentry/stories/storyBook'; import {space} from 'sentry/styles/space'; export default storyBook(Confirm, story => { story('Triggers', () => (

There are two way to use , either as a wrapper around a trigger, or by calling openConfirmModal() in a callback.

It's recommended to call openConfirmModal().

)); story('Labels', () => (

You must implement at least , but have the option of implementing{' '} instead.

), }) } > With ReactNode Labels
)); story('Callbacks & bypass={true}', () => { const [callbacks, setCallbacks] = useState([]); return (

There is also a prop called . This can help to skip the Confirm dialog, for example if not enough items are selected in a bulk-change operation, and directly run the{' '} callback.