import { Image } from '@tarojs/components';

import { Cell } from '@taroify/core';
import { GoodJob } from '@taroify/icons';
import classNames from 'classnames';
import { useCallback } from 'react';

import CertificationStatus from '@/components/certification-status';
import WechatCell from '@/components/wx-cell';
import { PageUrl } from '@/constants/app';
import useUserInfo from '@/hooks/use-user-info';
import { navigateTo } from '@/utils/route';

import './index.less';

const PREFIX = 'user-fragment-company';

export default function CompanyFragment() {
  const userInfo = useUserInfo();
  // const [showPublish, setShowPublish] = useState(false);

  const handlePublishJob = useCallback(async () => {
    navigateTo(PageUrl.CertificationManage);
  }, [userInfo]);

  const handleClickInviteOperations = useCallback(() => navigateTo(PageUrl.InviteOperations, { company: 1 }), []);

  return (
    <div className={PREFIX}>
      <CertificationStatus className={`${PREFIX}__cell`} />
      <WechatCell className={`${PREFIX}__cell`} />
      <Cell
        isLink
        align="center"
        title={
          <div className={`${PREFIX}__recommend-cell`}>
            免费领企业会员
            <div className={`${PREFIX}__recommend`}>
              <GoodJob />
              强烈推荐
            </div>
          </div>
        }
        className={`${PREFIX}__cell`}
        onClick={handleClickInviteOperations}
      />
      <Cell
        isLink
        align="center"
        title={
          <div>
            <div className={`${PREFIX}__cell-icon`}>
              <Image src="https://publiccdn.neighbourhood.com.cn/img/lightning.svg" />
            </div>
            发布急招主播岗位
          </div>
        }
        className={classNames(`${PREFIX}__cell`, `${PREFIX}__go-publish-cell`)}
        onClick={handlePublishJob}
      >
        去发布
      </Cell>
      {/* <div>{showPublish && <CompanyPublishJobDialog userInfo={userInfo} onClose={() => setShowPublish(false)} />}</div> */}
    </div>
  );
}
