ticket_manager/client/src/components/Modal.tsx

24 lines
672 B
TypeScript

import React, { FC, useState, CSSProperties } from "react";
interface IProps {
handleClose: () => void;
show: boolean;
}
export const Modal: FC<IProps> = ({ handleClose, show, children }) => {
const showHideStyle: CSSProperties = show
? { display: "block", zIndex: 10 }
: { display: "none", zIndex: 10 };
return (
<div className="modal" style={showHideStyle}>
<div className="modal-content">{children}</div>
{/* <div className="modal-footer">
<button
className="modal-close waves-effect waves-green btn-flat"
onClick={handleClose}
>
close
</button>
</div> */}
</div>
);
};