import React, { JSX } from 'react';
import { Image, StyleSheet, Text, View } from 'react-native';

type Props = {
  text?: string;
};

export default function ListEmpty(props: Props): JSX.Element {
  return (
    <View style={styles.container}>
      <Image
        style={styles.image}
        resizeMode="contain"
        source={require('@common/assets/images/common_list_empty.png')}
      />
      <Text style={styles.text}>
        {props.text && props.text.length > 0 ? props.text : '暂无数据'}
      </Text>
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    alignItems: 'center',
    justifyContent: 'center',
    marginTop: 50,
    marginBottom: 20,
  },
  image: {
    width: 150,
    height: 102,
  },
  text: {
    textAlign: 'center',
    color: '#6B6B75',
    fontSize: 14,
    marginTop: 15,
  },
});
