MCPcopy Create free account
hub / github.com/sqlchat/sqlchat / Modal

Function Modal

src/components/kit/Modal.tsx:12–34  ·  view source on GitHub ↗
(props: Props)

Source from the content-addressed store, hash-verified

10}
11
12const Modal = (props: Props) => {
13 const { children, title, onClose, className } = props;
14
15 return (
16 <ModalUI className="!z-100" open={true} onClose={onClose}>
17 <div
18 className={`${
19 className || ""
20 } flex flex-col bg-white dark:bg-zinc-800 rounded-xl p-4 fixed top-[50%] left-[50%] h-auto max-h-[85vh] w-[90vw] max-w-[90vw] sm:max-w-lg translate-x-[-50%] translate-y-[-50%] z-100 outline-none`}
21 >
22 <p className="text-lg pl-1 text-black dark:text-gray-300 font-medium mb-2">{title}</p>
23 <button
24 className="absolute top-3 right-3 outline-none w-8 h-8 p-1 bg-zinc-600 rounded-full text-gray-300 hover:opacity-80"
25 aria-label="Close"
26 onClick={onClose}
27 >
28 <Icon.IoClose className="w-full h-auto" />
29 </button>
30 <div className="w-full px-1 h-[calc(100%-36px)] flex flex-col justify-start items-start overflow-y-auto">{children}</div>
31 </div>
32 </ModalUI>
33 );
34};
35
36export default Modal;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected