mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-18 19:46:44 +08:00
feat: modify routing to nested mode and rename document (#52)
* feat: modify routing to nested mode * feat: rename document
This commit is contained in:
24
web/src/components/modal-manager.tsx
Normal file
24
web/src/components/modal-manager.tsx
Normal file
@ -0,0 +1,24 @@
|
||||
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;
|
||||
Reference in New Issue
Block a user