mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-12 16:35:49 +01:00
🏗️ 💥 Change the whole folder structure.
Now using src as a subfolder to the source files
This commit is contained in:
18
src/components/Config/SaveConfig.tsx
Normal file
18
src/components/Config/SaveConfig.tsx
Normal file
@@ -0,0 +1,18 @@
|
||||
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'), `${config.name}.json`);
|
||||
}
|
||||
}
|
||||
return (
|
||||
<Button leftIcon={<Download />} variant="outline" onClick={onClick}>
|
||||
Download your config
|
||||
</Button>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user