import './MenuIconBlock.scss';
import { Component } from '@tarojs/taro';
import { View, Image, Text } from '@tarojs/components';
import { ComponentClass } from 'react';

type PageOwnProps = {
  icon: string;
  text: string;
  onClick: () => void;
};

interface MenuIconBlock {
  props: PageOwnProps;
}
class MenuIconBlock extends Component {
  render() {
    const { icon, text, onClick } = this.props;
    return (
      <View className='MenuIconBlock' onClick={onClick}>
        <Image className='bg' src={icon} />
        <Text className='text'>{text}</Text>
      </View>
    );
  }
}

export default MenuIconBlock as ComponentClass<PageOwnProps>;
