'use client' import { useEffect, useState } from 'react' import { Button, Form, Modal } from 'ui' // [Joshen] As of 280222, let's just use ConfirmationModal as the one and only confirmation modal (Deprecate this) interface ConfirmModalProps { visible: boolean danger?: boolean title: string description: string size?: 'tiny' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge' buttonLabel: string buttonLoadingLabel?: string onSelectCancel: () => void onSelectConfirm: () => void } /** @deprecated use ConfirmationModal instead */ const ConfirmModal = ({ visible = false, danger = false, title = '', description = '', size = 'small', buttonLabel = '', buttonLoadingLabel = '', onSelectCancel = () => {}, onSelectConfirm = () => {}, }: ConfirmModalProps) => { useEffect(() => { if (visible) { setLoading(false) } }, [visible]) const [loading, setLoading] = useState(false) const onConfirm = () => { setLoading(true) onSelectConfirm() } return (
onConfirm()} validate={() => { return [] }} > {() => { return ( <>
) }}
) } export default ConfirmModal