2021-12-09 23:51:30 +00:00
|
|
|
import classNames from "classnames";
|
|
|
|
import React from "react";
|
|
|
|
|
2022-03-17 13:20:49 +00:00
|
|
|
import { Dialog, DialogContent, DialogFooter } from "@calcom/ui/Dialog";
|
|
|
|
|
2021-12-09 23:51:30 +00:00
|
|
|
interface Props extends React.PropsWithChildren<any> {
|
|
|
|
wide?: boolean;
|
|
|
|
scroll?: boolean;
|
|
|
|
noPadding?: boolean;
|
2022-03-17 13:20:49 +00:00
|
|
|
isOpen: boolean;
|
|
|
|
onExit: () => void;
|
2021-12-09 23:51:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export default function ModalContainer(props: Props) {
|
|
|
|
return (
|
2022-03-17 13:20:49 +00:00
|
|
|
<div className="flex min-h-screen items-end justify-center px-4 pt-4 pb-20 text-center sm:block sm:p-0">
|
|
|
|
<Dialog open={props.isOpen} onOpenChange={props.onExit}>
|
|
|
|
<DialogContent>
|
|
|
|
<div
|
|
|
|
className={classNames(
|
|
|
|
"inline-block transform bg-white text-left align-bottom transition-all sm:align-middle",
|
|
|
|
{
|
|
|
|
"sm:w-full sm:max-w-lg ": !props.wide,
|
|
|
|
"sm:w-4xl sm:max-w-4xl": props.wide,
|
|
|
|
"overflow-scroll": props.scroll,
|
|
|
|
"!p-0": props.noPadding,
|
|
|
|
}
|
|
|
|
)}>
|
|
|
|
{props.children}
|
|
|
|
</div>
|
|
|
|
</DialogContent>
|
|
|
|
</Dialog>
|
2021-12-09 23:51:30 +00:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|