import React from 'react' import {type StyleProp, type TextStyle, type ViewStyle} from 'react-native' import {View} from 'react-native' import {usePalette} from '#/lib/hooks/usePalette' import {useWebMediaQueries} from '#/lib/hooks/useWebMediaQueries' import {atoms as a, useBreakpoints, useTheme} from '#/alf' import {Button, type ButtonProps, ButtonText} from '#/components/Button' import {EditBig_Stroke1_Corner0_Rounded as EditIcon} from '#/components/icons/EditBig' import {Text} from '#/components/Typography' export type EmptyStateButtonProps = Omit & { label: string text: string } export function EmptyState({ testID, icon, iconSize = '3xl', message, style, textStyle, button, }: { testID?: string icon?: React.ComponentType | React.ReactElement iconSize?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' message: string style?: StyleProp textStyle?: StyleProp button?: EmptyStateButtonProps }) { const pal = usePalette('default') const {isTabletOrDesktop} = useWebMediaQueries() const t = useTheme() const {gtMobile} = useBreakpoints() const placeholderIcon = ( ) const renderIcon = () => { if (!icon) { return placeholderIcon } if (React.isValidElement(icon)) { return icon } if ( typeof icon === 'function' || (typeof icon === 'object' && icon && 'render' in icon) ) { const IconComponent = icon return ( ) } return placeholderIcon } return ( {renderIcon()} {message} {button && ( )} ) }