import React, {useState, ReactNode} from 'react'; import {View, Text, StyleSheet, ViewStyle, Image} from 'react-native'; import {$Theme, $Colors} from './style'; export type EmptyProps = { title?: string; source?: string; desc?: string; loading?: boolean; loadingText?: string; style?: ViewStyle; top?: ReactNode; bottom?: ReactNode; }; const Empty: React.FC = ({title, loading, loadingText = '加载中...', desc = '抱歉没有符合您筛选条件的餐厅', source, style, top, bottom}) => { // TODO: change to SVG return ( {top ? top : title ? {title} : null} {loading ? loadingText : desc} {bottom} ); }; export default Empty; const styles = StyleSheet.create({ wrapper: { flex: 1, ...$Theme.flexCol, height: '100%', marginTop: 100, }, img: { width: 136, height: 136, }, desc: { fontSize: 14, color: $Colors.lightText, }, title: { fontSize: 16, color: $Colors.normalText, lineHeight: 22, marginTop: 14, marginBottom: 8, }, });