strapi-plugin-config-sync/admin/src/components/FirstExport/index.js

34 lines
957 B
JavaScript
Raw Normal View History

2021-03-24 22:03:30 +01:00
import React, { useState } from 'react';
import { useDispatch } from 'react-redux';
2021-11-13 14:30:16 +01:00
import { NoContent } from '@strapi/helper-plugin';
import { Button } from '@strapi/design-system/Button';
2021-10-14 17:13:12 +02:00
2021-03-24 22:03:30 +01:00
import { exportAllConfig } from '../../state/actions/Config';
import ConfirmModal from '../ConfirmModal';
const FirstExport = () => {
const dispatch = useDispatch();
const [modalIsOpen, setModalIsOpen] = useState(false);
return (
2021-11-13 14:30:16 +01:00
<div>
2021-03-24 22:03:30 +01:00
<ConfirmModal
isOpen={modalIsOpen}
onClose={() => setModalIsOpen(false)}
2021-10-14 17:13:12 +02:00
type="export"
onSubmit={() => dispatch(exportAllConfig())}
2021-03-24 22:03:30 +01:00
/>
2021-11-13 14:30:16 +01:00
<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>}
/>
2021-03-24 22:03:30 +01:00
</div>
);
2021-10-14 17:13:12 +02:00
};
export default FirstExport;