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

38 lines
1.1 KiB
React
Raw Normal View History

import React from 'react';
2023-10-15 03:53:57 +02:00
import { useIntl } from 'react-intl';
2021-03-24 22:03:30 +01:00
import { useDispatch } from 'react-redux';
2024-05-08 20:46:09 +02:00
import { getFetchClient, useNotification } from '@strapi/strapi/admin';
2024-04-03 20:55:53 +02:00
import { Button, EmptyStateLayout } from '@strapi/design-system';
import { EmptyDocuments } from '@strapi/icons/symbols';
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 = () => {
2024-05-08 20:46:09 +02:00
const { post, get } = getFetchClient();
const { toggleNotification } = useNotification();
2021-03-24 22:03:30 +01:00
const dispatch = useDispatch();
2023-10-11 20:46:51 +02:00
const { formatMessage } = useIntl();
2021-03-24 22:03:30 +01:00
return (
2021-11-13 14:30:16 +01:00
<div>
2024-04-03 20:55:53 +02:00
<EmptyStateLayout
content={formatMessage({ id: 'config-sync.FirstExport.Message' })}
action={(
<ConfirmModal
type="export"
onSubmit={() => dispatch(exportAllConfig([], toggleNotification, formatMessage, post, get))}
trigger={(
<Button>{formatMessage({ id: 'config-sync.FirstExport.Button' })}</Button>
)}
/>
)}
icon={<EmptyDocuments width={160} />}
2021-11-13 14:30:16 +01:00
/>
2021-03-24 22:03:30 +01:00
</div>
);
2021-10-14 17:13:12 +02:00
};
export default FirstExport;