import { PageContainer, ProTable } from "@ant-design/pro-components"
import { columns } from "./tableConfig"
import { useAjax } from "@/Hook/useAjax"
import { useModel } from "@umijs/max"
import { longBookReadLogList } from "@/services/miniApp/readLog"

const Page: React.FC = () => {
    let { initialState } = useModel("@@initialState")
    let getList = useAjax((params) => longBookReadLogList(params), { type: 'table' })
    return <PageContainer title={false}
    >
        <ProTable<any, any>
          scroll={{ x: 'max-content' }}
            params={{
                appId: initialState?.selectApp?.id || "",
                distributorId: initialState?.currentUser?.distributorId,
                appType: initialState?.selectApp?.appType || ""
            }}
            headerTitle={"小说阅读记录列表"}
            rowKey={(r) => r.id}
            search={{
                labelWidth: 120,
            }}
            request={async (params) => {
                return await getList.run(params)
            }}
            columns={columns()}
        // bordered
        />
    </PageContainer>

}
export default Page