mirror of
https://github.com/ajnart/homarr.git
synced 2025-10-31 18:46:23 +01:00
19 lines
534 B
TypeScript
19 lines
534 B
TypeScript
import { Button } from '@mantine/core';
|
|
import fileDownload from 'js-file-download';
|
|
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>
|
|
);
|
|
}
|