"use client";
import turnosXpressTheme from "@core/app/theme/turnosXpress";
import { ThemeProvider } from "@emotion/react";
import Dialog from "@mui/material/Dialog";
import React from "react";

export interface DialogWindowParams {
    children: React.ReactNode;
    visible: boolean;
    setVisible: (state: boolean) => void;
}

export default function DialogWindow(props: DialogWindowParams) {
    const { visible, setVisible, children } = props;
    const handleClose = () => {
        setVisible(false);
    };

    return (
        <>
            <ThemeProvider theme={turnosXpressTheme}>
                <Dialog
                    open={visible}
                    onClose={handleClose}
                    aria-labelledby="alert-dialog-title"
                    aria-describedby="alert-dialog-description"
                >
                    {children}
                </Dialog>
            </ThemeProvider>
        </>
    );
}
