35 lines
1.0 KiB
JavaScript
35 lines
1.0 KiB
JavaScript
import React, { useState } from 'react';
|
|
import { useDispatch } from 'react-redux';
|
|
import { NoContent, useNotification } from '@strapi/helper-plugin';
|
|
import { Button } from '@strapi/design-system/Button';
|
|
|
|
import { exportAllConfig } from '../../state/actions/Config';
|
|
import ConfirmModal from '../ConfirmModal';
|
|
|
|
const FirstExport = () => {
|
|
const toggleNotification = useNotification();
|
|
const dispatch = useDispatch();
|
|
const [modalIsOpen, setModalIsOpen] = useState(false);
|
|
|
|
return (
|
|
<div>
|
|
<ConfirmModal
|
|
isOpen={modalIsOpen}
|
|
onClose={() => setModalIsOpen(false)}
|
|
type="export"
|
|
onSubmit={() => dispatch(exportAllConfig([], toggleNotification))}
|
|
/>
|
|
<NoContent
|
|
content={{
|
|
id: 'emptyState',
|
|
defaultMessage:
|
|
'Looks like this is your first time using config-sync for this project.',
|
|
}}
|
|
action={<Button onClick={() => setModalIsOpen(true)}>Make the initial export</Button>}
|
|
/>
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default FirstExport;
|