diff --git a/src/states/Dashboard/pages/Info/components/Settings/components/Delete/Delete.jsx b/src/states/Dashboard/pages/Info/components/Settings/components/Delete/Delete.jsx new file mode 100644 index 0000000..cd31c27 --- /dev/null +++ b/src/states/Dashboard/pages/Info/components/Settings/components/Delete/Delete.jsx @@ -0,0 +1,29 @@ +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); + } + } + + return ( + + Projekt löschen + + Diese Aktion kann nicht Rückgängig gemacht + werden. Ich hoffe du weißt, was du tust. + + + + + ) +} \ No newline at end of file