1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-01 21:57:06 +01:00
metamask-extension/ui/components/app/snaps/install-error/install-error.js
George Marshall bf61322ee1
Update Text import paths: /app (#20083)
* Updating import paths

* Updating snapshots

* Fixing lint issues

* Updating snapshots
2023-07-19 15:32:35 -07:00

60 lines
1.5 KiB
JavaScript

import React from 'react';
import PropTypes from 'prop-types';
import Box from '../../../ui/box/box';
import {
AlignItems,
BackgroundColor,
BLOCK_SIZES,
FLEX_DIRECTION,
FONT_WEIGHT,
IconColor,
JustifyContent,
TextAlign,
TextVariant,
} from '../../../../helpers/constants/design-system';
import ActionableMessage from '../../../ui/actionable-message/actionable-message';
import { AvatarIcon, IconSize, Text } from '../../../component-library';
const InstallError = ({ title, error, description, iconName }) => {
return (
<Box
flexDirection={FLEX_DIRECTION.COLUMN}
alignItems={AlignItems.center}
justifyContent={JustifyContent.center}
height={BLOCK_SIZES.FULL}
padding={2}
>
{iconName && (
<AvatarIcon
iconName={iconName}
size={IconSize.Xl}
iconProps={{
size: IconSize.Xl,
}}
color={IconColor.errorDefault}
backgroundColor={BackgroundColor.errorMuted}
marginBottom={4}
/>
)}
<Text fontWeight={FONT_WEIGHT.BOLD} variant={TextVariant.headingLg}>
{title}
</Text>
{description && <Text textAlign={TextAlign.Center}>{description}</Text>}
{error && (
<Box padding={2}>
<ActionableMessage type="danger" message={error} />
</Box>
)}
</Box>
);
};
InstallError.propTypes = {
title: PropTypes.node.isRequired,
error: PropTypes.string,
description: PropTypes.string,
iconName: PropTypes.string,
};
export default InstallError;