mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-03 20:15:57 +01:00
We can now load as much data as we want in the services and settings values. This solves the issue of using multiple localStorages boxes
21 lines
642 B
TypeScript
21 lines
642 B
TypeScript
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';
|
|
import { useConfig } from '../../tools/state';
|
|
|
|
export default function SaveConfigComponent(props: any) {
|
|
|
|
const { config } = useConfig();
|
|
function onClick(e: any) {
|
|
if (config) {
|
|
fileDownload(JSON.stringify(config, null, '\t'), 'services.json');
|
|
}
|
|
}
|
|
return (
|
|
<Button leftIcon={<Download />} variant="outline" onClick={onClick}>
|
|
Download your config
|
|
</Button>
|
|
);
|
|
}
|