16 lines
351 B
TypeScript
16 lines
351 B
TypeScript
import { useCallback, useState } from 'react'
|
|
|
|
export const useToggleConfirm = () => {
|
|
const [showConfirm, setShowConfirm] = useState(false)
|
|
|
|
const handleShow = useCallback(() => setShowConfirm(true), [])
|
|
|
|
const handleClose = useCallback(() => setShowConfirm(false), [])
|
|
|
|
return {
|
|
open: showConfirm,
|
|
handleShow,
|
|
handleClose,
|
|
}
|
|
}
|