import {Fragment} from 'react'; import Confirm from 'sentry/components/confirm'; type ConfirmProps = React.ComponentProps; type Props = { children: React.ReactNode | ConfirmProps['children']; shouldConfirm?: boolean; } & Partial< Pick > & Pick; export default function ConfirmableAction({shouldConfirm, children, ...props}: Props) { if (shouldConfirm) { return {children as ConfirmProps['children']}; } return {children}; }