import Layout from "@/components/layout/Layout";
import { View } from "@tarojs/components";
import  { useDidShow } from "@tarojs/taro";
import React from "react";
import { usePageContent } from "./hooks";

const BizCardTpl02 = React.lazy(() =>
  import("@/components/business").then((module) => ({
    default: module.BizCardTpl02,
  })),
);

const ImageTpl = React.lazy(() => import("@/components/business").then((module) => ({
  default: module.ImageTpl,
})));

export default function Index() {
  const { pageLoading, pageContent, refresherConfig, loadPageContent } = usePageContent();

  useDidShow(async () => {
    await loadPageContent("测试身份编码");
    console.log("Page shown.");
  });
  
  return (
    <Layout loadding={pageLoading}>
      <Layout.Header hideBack={false}>{pageContent}</Layout.Header>
      <Layout.Container
        className="bg-bg-gray"
        refresherConfig={refresherConfig}
      >
        <View className="space-y-4 p-3">
            <BizCardTpl02 />
            <ImageTpl size="medium" src=""></ImageTpl>
        </View>
      </Layout.Container>
    </Layout>
  );
}
