From dc84acdc0c36cb50fd8ef7fa9605fcd13c2e199e Mon Sep 17 00:00:00 2001 From: Aj - Thomas Date: Wed, 27 Apr 2022 03:12:05 +0200 Subject: [PATCH] Add Config saver --- components/Config/SaveConfig.tsx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 components/Config/SaveConfig.tsx diff --git a/components/Config/SaveConfig.tsx b/components/Config/SaveConfig.tsx new file mode 100644 index 000000000..a95643980 --- /dev/null +++ b/components/Config/SaveConfig.tsx @@ -0,0 +1,18 @@ +import { Anchor, Button, ThemeIcon, Tooltip } from '@mantine/core'; +import fileDownload from 'js-file-download'; +import { Dropzone, DropzoneStatus, IMAGE_MIME_TYPE } from '@mantine/dropzone'; +import { Download } from 'tabler-icons-react'; + +export default function SaveConfigComponent(props: any) { + function onClick(e: any) { + const services = localStorage.getItem('services'); + if (services) { + fileDownload(JSON.stringify(JSON.parse(services), null, '\t'), 'services.json'); + } + } + return ( + + ); +}