import React, { useCallback, useState } from 'react'; import { SilkeButton, SilkeButtonProps } from './silke-button'; import { SilkeConfirmationModal, SilkeConfirmationModalProps } from '../silke-modal'; type SilkeConfirmationButtonProps = { message?: React.ReactNode; modalSize?: SilkeConfirmationModalProps['size']; } & Omit & Omit; export function SilkeConfirmationButton({ message, title, confirmKind, confirmIcon, confirmLabel, rejectLabel, modalSize = 'small', onConfirm, ...rest }: SilkeConfirmationButtonProps) { const [show, setShow] = useState(false); const handleToggle = useCallback(() => setShow(!show), [show]); const handleConfirm = useCallback(() => { setShow(!show); onConfirm(); }, [show, onConfirm]); return ( <> {message} ); }