1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-02 14:15:06 +01:00
metamask-extension/ui/components/app/flask/snap-delineator/snap-delineator.js
2023-02-02 20:15:26 +00:00

60 lines
1.5 KiB
JavaScript

import React from 'react';
import PropTypes from 'prop-types';
import { useI18nContext } from '../../../../hooks/useI18nContext';
import {
BorderStyle,
Size,
BorderColor,
BorderRadius,
AlignItems,
BackgroundColor,
IconColor,
TextVariant,
TextColor,
} from '../../../../helpers/constants/design-system';
import Box from '../../../ui/box';
import { Icon, Text } from '../../../component-library';
export const SnapDelineator = ({ snapName, children }) => {
const t = useI18nContext();
return (
<Box
className="snap-delineator__wrapper"
borderStyle={BorderStyle.solid}
borderColor={BorderColor.borderMuted}
borderRadius={BorderRadius.LG}
>
<Box
className="snap-delineator__header"
alignItems={AlignItems.center}
backgroundColor={BackgroundColor.infoMuted}
paddingLeft={2}
paddingRight={2}
paddingTop={1}
paddingBottom={1}
>
<Icon name="snaps" color={IconColor.infoDefault} size={Size.SM} />
<Text
variant={TextVariant.bodySm}
color={TextColor.infoDefault}
className="snap-delineator__header__text"
marginLeft={1}
marginTop={0}
marginBottom={0}
>
{t('contentFromSnap', [snapName])}
</Text>
</Box>
<Box className="snap-delineator__content" padding={4}>
{children}
</Box>
</Box>
);
};
SnapDelineator.propTypes = {
snapName: PropTypes.string,
children: PropTypes.ReactNode,
};