import React, { useState } from 'react'; import ConfigureSnapPopup, { ConfigureSnapPopupType, } from '../../../components/app/configure-snap-popup/configure-snap-popup'; import { BUTTON_VARIANT, Box, Button, Icon, IconName, Tag, } from '../../../components/component-library'; import { Text } from '../../../components/component-library/text/deprecated'; import { AlignItems, BackgroundColor, BorderColor, Display, FlexDirection, JustifyContent, TextColor, TextVariant, } from '../../../helpers/constants/design-system'; import { useI18nContext } from '../../../hooks/useI18nContext'; import { SnapCardProps } from '../new-snap-account-page/new-snap-account-page'; import { METAMASK_DEVELOPER } from '../constants'; export const SnapDetailHeader = ({ updateAvailable, snapTitle, isInstalled, iconUrl, developer, auditUrls, website, }: Pick< SnapCardProps, | 'updateAvailable' | 'snapTitle' | 'isInstalled' | 'iconUrl' | 'developer' | 'auditUrls' | 'website' >) => { const t = useI18nContext(); const [showConfigPopover, setShowConfigPopover] = useState(false); const [showConfigPopoverType, setShowConfigPopoverType] = useState(ConfigureSnapPopupType.INSTALL); return ( <> {snapTitle} {snapTitle} {isInstalled && ( )} {isInstalled && updateAvailable && ( )} {isInstalled && ( )} {!isInstalled && ( )} {developer.toLowerCase() === METAMASK_DEVELOPER && ( {' '} {t('snapCreatedByMetaMask')} } labelProps={{ color: TextColor.infoDefault, }} className="" marginRight={1} /> )} {auditUrls.length > 0 && ( {' '} {t('snapIsAudited')} } labelProps={{ color: TextColor.infoDefault, }} /> )} setShowConfigPopover(false)} link={website} /> ); };