import { ReactNode, useState } from "react"; import { Button, ButtonProps, Modal, ModalProps } from "@patternfly/react-core"; export type ContinueCancelModalProps = Omit & { modalTitle: string; continueLabel: string; cancelLabel: string; buttonTitle: string | ReactNode; buttonVariant?: ButtonProps["variant"]; isDisabled?: boolean; onContinue: () => void; component?: React.ElementType | React.ComponentType; children?: ReactNode; }; export const ContinueCancelModal = ({ modalTitle, continueLabel, cancelLabel, buttonTitle, isDisabled, buttonVariant, onContinue, component = Button, children, ...rest }: ContinueCancelModalProps) => { const [open, setOpen] = useState(false); const Component = component; return ( <> setOpen(true)} isDisabled={isDisabled} > {buttonTitle} setOpen(false)} actions={[ , , ]} > {children} ); };