import {Profile} from "@/store"; import {Image, Text, View} from "@tarojs/components"; import styles from "@/pages/my/my.module.scss"; import avatar from "@/static/img/avatar.png" import blacktriang from "@/static/img/blacktriangle.png" import {FC, useMemo} from "react"; import Img from "@/components/image/image"; interface Props { companyList: Company[] showCompany: () => void } const Header: FC = ({companyList, showCompany}) => { const {token, user, company, empty} = Profile.useContainer() const login = () => empty() const showChoose = useMemo(() => (token?.length ?? 0) > 0 && companyList.length >2, [token, companyList]) return ( {token ? user?.name ?? '匿名' : '请登录'} {token ? company?.name : '登录解锁更多功能哦'} {showChoose && } ) } export default Header