import MuiDialog from "@/components/MuiDialog"; import { Button, Card, Checkbox, DialogActions, Grid, Typography } from "@mui/material"; import { Paper } from "@mui/material"; import { Stack } from '@mui/material'; import React, { useState } from 'react'; import { DetailFinalLogType } from "../Model/Types"; import { fDateTimesecond, toTitleCase } from "@/utils/formatTime"; import axios from "@/utils/axios"; import { enqueueSnackbar } from "notistack"; import { useNavigate } from "react-router"; type DialogDeleteType = { openDialog: boolean; setOpenDialog: any; onSubmit?: void; id: number|undefined; } export default function DialogDeleteMedicine({id, setOpenDialog, openDialog,onSubmit} : DialogDeleteType ) { const handleSubmit = () => { axios .delete(`customer-service/request/medicine-data/${id}`) .then((response) => { enqueueSnackbar('Medicine Data has Deleted', { variant: 'success' }); setOpenDialog(false); window.location.reload() }) .catch(({ response }) => { enqueueSnackbar(response.data.message ?? 'Something went wrong!', { variant: 'error' }); }); } const style1 = { color: '#919EAB', width: '30%' } const style2 = { width: '70%' } const marginBottom1 = { marginBottom: 1, } const handleCloseDialog = () => { setOpenDialog(false); } const getContent = () => ( Are you sure to delete this detail medicine ? ); return ( ); }