mirror of
https://github.com/jeffvli/feishin.git
synced 2026-08-10 14:23:18 +02:00
add initial files
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import {
|
||||
Modal as MantineModal,
|
||||
ModalProps as MantineModalProps,
|
||||
} from '@mantine/core';
|
||||
import { useDisclosure } from '@mantine/hooks';
|
||||
|
||||
interface ModalProps extends MantineModalProps {
|
||||
condition: boolean;
|
||||
}
|
||||
|
||||
export const Modal = ({ condition, children, ...rest }: ModalProps) => {
|
||||
const [opened, handlers] = useDisclosure(false);
|
||||
|
||||
return (
|
||||
<>
|
||||
{condition && (
|
||||
<MantineModal
|
||||
{...rest}
|
||||
opened={opened}
|
||||
onClose={() => handlers.close()}
|
||||
>
|
||||
{children}
|
||||
</MantineModal>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user