FPSMS-frontend
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

82 lines
1.9 KiB

  1. import * as React from "react";
  2. import {
  3. Card,
  4. CardHeader,
  5. CardContent,
  6. SxProps,
  7. Theme,
  8. Grid,
  9. Modal,
  10. Typography,
  11. Button,
  12. } from "@mui/material";
  13. import { DataGrid, GridColDef } from "@mui/x-data-grid";
  14. import { darken, lighten, styled } from "@mui/material/styles";
  15. import { PROJECT_MODAL_STYLE } from "@/theme/colorConst";
  16. import { useRef, useEffect, useState } from "react";
  17. import Swal from "sweetalert2";
  18. import styledcmp from "styled-components";
  19. const CardWrapper = styledcmp.div`
  20. /* Styles for the card when not hovered */
  21. background-color: #f0f0f0,
  22. padding: 10px,
  23. /* ...other styles... */
  24. &:hover {
  25. /* Styles for the card when hovered */
  26. background-color: #c0c0c0,
  27. /* ...other hover styles... */
  28. }
  29. `;
  30. interface CustomModalProps {
  31. title?: string;
  32. isOpen: boolean;
  33. onClose: () => void;
  34. modalStyle?: any;
  35. }
  36. const CustomModal: React.FC<CustomModalProps> = ({ ...props }) => {
  37. const ModalContent = () => {
  38. return (
  39. // <Grid item sx={{ m: 3 }}>
  40. <div>
  41. <Typography variant="h6" id="modal-title">
  42. {props.title ?? "Modal Title"}
  43. </Typography>
  44. <Typography
  45. variant="h6"
  46. id="modal-title"
  47. style={{ alignSelf: "flex-start", margin: "10px" }}
  48. >
  49. Modal Content
  50. </Typography>
  51. <div
  52. style={{
  53. display: "flex",
  54. justifyContent: "space-between",
  55. width: "100%",
  56. }}
  57. >
  58. <Button variant="contained" onClick={props.onClose}>
  59. Confirm
  60. </Button>
  61. <Button variant="contained" onClick={props.onClose}>
  62. Cancel
  63. </Button>
  64. </div>
  65. </div>
  66. // </Grid>
  67. );
  68. };
  69. return (
  70. <Modal open={props.isOpen} onClose={props.onClose}>
  71. {props.modalStyle ? <props.modalStyle props={props} /> : <ModalContent />}
  72. </Modal>
  73. );
  74. };
  75. export default CustomModal;