import { Cell } from '@nutui/nutui-react-taro'
import {useEffect, useState} from "react";
import {myPageBszxBm} from "@/api/bszx/bszxBm";
import {BszxBm} from "@/api/bszx/bszxBm/model";
import navTo from "@/utils/common";

const BmLog = () => {
  const [list, setList] = useState<BszxBm[]>()
  const reload = () => {
    myPageBszxBm({limit: 1000}).then(res => {
      if(res.list){
        setList(res.list);
      }
    })
  }

  useEffect(() => {
    reload()
  }, [])

  return (
    <div className={'p-4'}>
      {list?.map((item, index) => {
        return (
          <Cell title={item.name} extra={item.createTime} key={index} onClick={() => {
            navTo('/bszx/bm-cert/bm-cert?id=' + item.id,true)
          }} />
        )
      })}
    </div>
  )
}
export default BmLog
