ragflow / web /src /components /modal-manager.tsx
balibabu
feat: modify routing to nested mode and rename document (#52)
7b71fb2
raw
history blame
470 Bytes
import { useState } from 'react';
interface IProps {
children: (props: {
showModal(): void;
hideModal(): void;
visible: boolean;
}) => React.ReactNode;
}
const ModalManager = ({ children }: IProps) => {
const [visible, setVisible] = useState(false);
const showModal = () => {
setVisible(true);
};
const hideModal = () => {
setVisible(false);
};
return children({ visible, showModal, hideModal });
};
export default ModalManager;