import {CSSProperties,FC} from "react";
import {View,Image} from "@tarojs/components";
import styles from './index.module.scss'
import NoLogin from '@/static/img/noLogin.png'
import {Profile} from "@/store";

interface Props {
  tips?: string
  height?: number
}

const LoginView: FC<Props> =  (props) => {
  const {empty} = Profile.useContainer()
  const text = props.tips ?? '登录后可查看更多内容'
  const size: string = props.height? `${props.height}px`:'0rpx'
  const sizeStyle: CSSProperties = {
    height:'1000rpx',
    paddingTop:size,
  }


  return (
    <View className={styles.content} style={sizeStyle}>
      <Image src={NoLogin}></Image>
      <View className={styles.title}>暂未登录</View>
      <View className={styles.label}>{text}</View>
      <View onClick={()=>{empty()}} className={styles.button}>立即登录</View>
    </View>
  )
}

export default LoginView
