Control the open state of a modal, drawer or any other disclosure, with optional callbacks.
This is custom React hooks, you need to follow the Basic Rules when you use it.
Open and close a modal from the handlers.
const useDisclosure = (
initialState?: boolean,
options?: { onOpen?: () => void; onClose?: () => void },
) => [
boolean,
{ open: () => void; close: () => void; toggle: () => void },
]