diff --git a/dashboard/src/states/Dashboard/pages/Info/components/Settings/components/Delete/Delete.jsx b/dashboard/src/states/Dashboard/pages/Info/components/Settings/components/Delete/Delete.jsx new file mode 100644 index 0000000..9edfe31 --- /dev/null +++ b/dashboard/src/states/Dashboard/pages/Info/components/Settings/components/Delete/Delete.jsx @@ -0,0 +1,28 @@ +import {Box, Button, Typography} from "@mui/material"; +import {Delete as DeleteIcon} from "@mui/icons-material"; +import {deleteRequest} from "@/common/utils/RequestUtil.js"; +import {useContext} from "react"; +import {ProjectContext} from "@/states/Dashboard/contexts/Project"; + +export const Delete = () => { + const {currentProject, updateProjects} = useContext(ProjectContext); + const deleteProject = async () => { + try { + await deleteRequest(`/project/${currentProject.id}`); + await updateProjects(); + } catch (e) { + console.error(e.message); + } + } + + return ( + + Delete project + + This action cannot be undone. I hope you know what you are doing. + + + + + ) +} \ No newline at end of file diff --git a/dashboard/src/states/Dashboard/pages/Info/components/Settings/components/Delete/index.js b/dashboard/src/states/Dashboard/pages/Info/components/Settings/components/Delete/index.js new file mode 100644 index 0000000..c4beb47 --- /dev/null +++ b/dashboard/src/states/Dashboard/pages/Info/components/Settings/components/Delete/index.js @@ -0,0 +1 @@ +export {Delete as default} from "./Delete.jsx"; \ No newline at end of file