diff --git a/src/states/Dashboard/pages/Info/components/Settings/components/Key/Key.jsx b/src/states/Dashboard/pages/Info/components/Settings/components/Key/Key.jsx new file mode 100644 index 0000000..a72b1c2 --- /dev/null +++ b/src/states/Dashboard/pages/Info/components/Settings/components/Key/Key.jsx @@ -0,0 +1,41 @@ +import {Box, Button, Stack, TextField, Typography} from "@mui/material"; +import {CopyAll, Refresh, Key as KeyIcon} from "@mui/icons-material"; +import {useContext} from "react"; +import {ProjectContext} from "@/states/Dashboard/contexts/Project"; +import {postRequest} from "@/common/utils/RequestUtil.js"; + +export const Key = () => { + const {currentProject, updateProjects} = useContext(ProjectContext); + + const copyKey = () => { + navigator.clipboard.writeText(currentProject.validationKey); + } + + const regenerateKey = async () => { + try { + await postRequest(`/project/${currentProject.id}/regenerate`); + await updateProjects(); + } catch (e) { + console.error(e); + } + + } + + return ( + + Prüfschlüssel + + Prüfschlüssel lassen sich für Clientseitige Projekte + verwenden. Sie dienen nur dem Bestätigen von + Lizenzen und haben keine weiteren Sonderrechte + }}/> + + + + + + + ) +} \ No newline at end of file