|
| 1 | +import React from 'react'; |
| 2 | +import {View} from 'react-native'; |
| 3 | +import type {BlockingViewProps} from '@components/BlockingViews/BlockingView'; |
| 4 | +import BlockingView from '@components/BlockingViews/BlockingView'; |
| 5 | +import Icon from '@components/Icon'; |
| 6 | +import TextBlock from '@components/TextBlock'; |
| 7 | +import {useMemoizedLazyExpensifyIcons} from '@hooks/useLazyAsset'; |
| 8 | +import useLocalize from '@hooks/useLocalize'; |
| 9 | +import useTheme from '@hooks/useTheme'; |
| 10 | +import useThemeStyles from '@hooks/useThemeStyles'; |
| 11 | +import variables from '@styles/variables'; |
| 12 | +import useEmptyLHNIllustration from './useEmptyLHNIllustration'; |
| 13 | + |
| 14 | +function LHNEmptyState() { |
| 15 | + const theme = useTheme(); |
| 16 | + const styles = useThemeStyles(); |
| 17 | + const {translate} = useLocalize(); |
| 18 | + const expensifyIcons = useMemoizedLazyExpensifyIcons(['MagnifyingGlass', 'Plus']); |
| 19 | + const emptyLHNIllustration = useEmptyLHNIllustration(); |
| 20 | + |
| 21 | + const subtitle = ( |
| 22 | + <View style={[styles.alignItemsCenter, styles.flexRow, styles.justifyContentCenter, styles.flexWrap, styles.textAlignCenter]}> |
| 23 | + <TextBlock |
| 24 | + color={theme.textSupporting} |
| 25 | + textStyles={[styles.textAlignCenter, styles.textNormal]} |
| 26 | + text={translate('common.emptyLHN.subtitleText1')} |
| 27 | + /> |
| 28 | + <Icon |
| 29 | + src={expensifyIcons.MagnifyingGlass} |
| 30 | + width={variables.emptyLHNIconWidth} |
| 31 | + height={variables.emptyLHNIconHeight} |
| 32 | + fill={theme.icon} |
| 33 | + small |
| 34 | + additionalStyles={styles.mh1} |
| 35 | + /> |
| 36 | + <TextBlock |
| 37 | + color={theme.textSupporting} |
| 38 | + textStyles={[styles.textAlignCenter, styles.textNormal]} |
| 39 | + text={translate('common.emptyLHN.subtitleText2')} |
| 40 | + /> |
| 41 | + <Icon |
| 42 | + src={expensifyIcons.Plus} |
| 43 | + width={variables.emptyLHNIconWidth} |
| 44 | + height={variables.emptyLHNIconHeight} |
| 45 | + fill={theme.icon} |
| 46 | + small |
| 47 | + additionalStyles={styles.mh1} |
| 48 | + /> |
| 49 | + <TextBlock |
| 50 | + color={theme.textSupporting} |
| 51 | + textStyles={[styles.textAlignCenter, styles.textNormal]} |
| 52 | + text={translate('common.emptyLHN.subtitleText3')} |
| 53 | + /> |
| 54 | + </View> |
| 55 | + ); |
| 56 | + |
| 57 | + return ( |
| 58 | + <BlockingView |
| 59 | + // eslint-disable-next-line react/jsx-props-no-spreading |
| 60 | + {...(emptyLHNIllustration as BlockingViewProps)} |
| 61 | + title={translate('common.emptyLHN.title')} |
| 62 | + CustomSubtitle={subtitle} |
| 63 | + accessibilityLabel={translate('common.emptyLHN.title')} |
| 64 | + /> |
| 65 | + ); |
| 66 | +} |
| 67 | + |
| 68 | +export default LHNEmptyState; |
0 commit comments