import IconCloseWhite from "@/images/icon-close-white.svg";
import { Image, View } from "@tarojs/components";
import Taro from "@tarojs/taro";
import { useState } from "react";
import styles from "./index.module.less";

interface CompProps {}
const Comp: React.FC<CompProps> = () => {
  const [hidden, setHidden] = useState(false);
  const handleCloseAction = () => {
    setHidden(true)
  };
  const handleCreateAction = () => {
    Taro.switchTab({
      url: "/pages/index/index",
    });
  }
  return hidden ? (
    <></>
  ) : (
    <View className={styles.container}>
      <View className={styles.closeBox} onClick={handleCloseAction}>
        <Image src={IconCloseWhite} className={styles.icon}></Image>
      </View>
      <View className={styles.text}>🥳 搭一个自己的智能主页吧～</View>
      <View className={styles.btn} onClick={handleCreateAction}>前往</View>
    </View>
  );
};

export default Comp;
