import React, { useState } from 'react'; import { SilkeButton, SilkeButtonKind } from '../silke-button'; import { SilkeIcons } from '../silke-icon'; import { SilkeModal, SilkeModalActions, SilkeModalContent, SilkeModalProps } from './silke-modal'; import { SilkeTextField } from '../silke-text-field'; import { SilkeBox } from '../silke-box'; export type SilkeConfirmationModalProps = { title?: string; /** * Label on confirm button */ confirmLabel: string; /** * Confirmation button kind * @default primary */ confirmKind?: SilkeButtonKind; confirmIcon?: SilkeIcons; /** * Label on reject button * @default Cancel */ rejectLabel?: string; onConfirm: () => void; isSubmitting?: boolean; /** On click of cancel button, will fallback to onClose if not defined */ onCancel?: () => void; /** * If set, the Confirm button will be disabled until the safeWord is entered */ safeWord?: string; } & SilkeModalProps; export function SilkeConfirmationModal({ children, confirmIcon, confirmKind = 'primary', confirmLabel, isSubmitting, onCancel, onConfirm, rejectLabel = 'Cancel', safeWord, ...rest }: SilkeConfirmationModalProps) { const [text, setText] = useState(); return ( {children} {safeWord && ( )} ); }