bigbuffet-rw/app/soapbox/features/ui/components/bundle_modal_error.tsx
marcin mikołajczak 9a207c970f TypeScript, React.FC
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2022-06-30 16:51:36 +02:00

45 lines
1.3 KiB
TypeScript

import React from 'react';
import { defineMessages, useIntl } from 'react-intl';
import IconButton from 'soapbox/components/icon_button';
const messages = defineMessages({
error: { id: 'bundle_modal_error.message', defaultMessage: 'Something went wrong while loading this page.' },
retry: { id: 'bundle_modal_error.retry', defaultMessage: 'Try again' },
close: { id: 'bundle_modal_error.close', defaultMessage: 'Close' },
});
interface IBundleModalError {
onRetry: () => void,
onClose: () => void,
}
const BundleModalError: React.FC<IBundleModalError> = ({ onRetry, onClose }) => {
const intl = useIntl();
const handleRetry = () => {
onRetry();
};
return (
<div className='modal-root__modal error-modal'>
<div className='error-modal__body'>
<IconButton title={intl.formatMessage(messages.retry)} icon='refresh' onClick={handleRetry} size={64} />
{intl.formatMessage(messages.error)}
</div>
<div className='error-modal__footer'>
<div>
<button
onClick={onClose}
className='error-modal__nav onboarding-modal__skip'
>
{intl.formatMessage(messages.close)}
</button>
</div>
</div>
</div>
);
};
export default BundleModalError;