import React, { useCallback } from 'react';
import { View, Text, TouchableOpacity } from 'react-native'
import SvgUri from 'react-native-svg-uri';
import styles from './style';
import { color } from '../../constants';
const svg:string = `
`
interface EmptyProps {
text?:string;
retryText?:string;
onTextPress?():void;
onlyText?: boolean
}
const Empty:React.FC = ({
onlyText=false,
retryText='',
text='暂无数据',
onTextPress
}:EmptyProps) => {
const handleTextPress = useCallback(() => {
if(!retryText) return;
onTextPress && onTextPress()
}, [onTextPress])
return (
{ onlyText ? null : }
{text}
{
!!retryText &&
{retryText}
}
)
}
export default Empty;