import { View } from "@tarojs/components";

import './index.scss'

export default function Loading(props) {
  const size = props.size || '200';
  const color = props.color || '#333';

  const boxStyle = `width: ${size}px; height: ${size}px;`
  const loadingStyle = `border-color: transparent ${color} transparent ${color};`
  const textStyle = `color: ${color};`

  const text = props.text || 'LOADING';

  return (
    <View className="loading-box" style={boxStyle}>
      <View className="loading" style={loadingStyle}></View>
      <View className="loading-text" style={textStyle}>{text}</View>
    </View>
  )
}
