File size: 968 Bytes
424c5d9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
"use client";
import BigBlueButton from "./BigBlueButton";
import { useTranslation } from "react-i18next";

export default function Modal({ children, onClose }) {
  const { t } = useTranslation();

  return (
    <div
      className="fixed inset-0 bg-gray-600 bg-opacity-25 overflow-y-auto h-full w-full flex items-center justify-center z-50"
      style={{ backgroundColor: 'rgba(75, 85, 99, 0.55)' }}
      onClick={(e) => { if (e.target === e.currentTarget) onClose(); }}
      onKeyDown={(e) => { if (e.key === 'Escape') onClose(); }}
      role="dialog"
      aria-modal="true"
      tabIndex={-1}
    >
      <div className="p-8 border w-96 shadow-lg rounded-md bg-white">
        <div className="text-center text-black">
          {children}
          <div className="flex justify-center mt-4">
            <BigBlueButton onClick={onClose}>
              {t('close')}
            </BigBlueButton>
          </div>
        </div>
      </div>
    </div>
  );
}