import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__ from "react/jsx-runtime";
import "react";
import * as __WEBPACK_EXTERNAL_MODULE__tachybase_client__ from "@tachybase/client";
import * as __WEBPACK_EXTERNAL_MODULE_antd__ from "antd";
import * as __WEBPACK_EXTERNAL_MODULE__createApp_mjs__ from "./createApp.mjs";
const schema = {
    type: 'void',
    name: 'root',
    'x-decorator': 'DataBlockProvider',
    'x-decorator-props': {
        collection: 'users',
        action: 'list'
    },
    'x-component': 'CardItem',
    properties: {
        demo: {
            type: 'array',
            'x-component': 'MyTable',
            'x-use-component-props': 'useTableProps'
        }
    }
};
const MyTable = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_client__.withDynamicSchemaProps)(__WEBPACK_EXTERNAL_MODULE_antd__.Table);
function useTableProps() {
    const { data, loading } = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_client__.useDataBlockRequest)();
    return {
        loading,
        dataSource: (null == data ? void 0 : data.data) || [],
        columns: [
            {
                title: 'UserName',
                dataIndex: 'username'
            },
            {
                title: 'NickName',
                dataIndex: 'nickname'
            },
            {
                title: 'Email',
                dataIndex: 'email'
            }
        ]
    };
}
const Demo = ()=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__tachybase_client__.SchemaComponent, {
        schema: schema
    });
const mocks = {
    'users:list': {
        data: [
            {
                id: '1',
                username: 'jack',
                nickname: 'Jack Ma',
                email: 'test@gmail.com'
            },
            {
                id: '2',
                username: 'jim',
                nickname: 'Jim Green'
            },
            {
                id: '3',
                username: 'tom',
                nickname: 'Tom Cat',
                email: 'tom@gmail.com'
            }
        ]
    },
    'roles:list': {
        data: [
            {
                name: 'root',
                title: 'Root',
                description: 'Root'
            },
            {
                name: 'admin',
                title: 'Admin',
                description: 'Admin description'
            }
        ]
    }
};
const App = (0, __WEBPACK_EXTERNAL_MODULE__createApp_mjs__.createApp)(Demo, {
    components: {
        MyTable
    },
    scopes: {
        useTableProps
    }
}, mocks);
const collection_table_list_rslib_entry_ = App;
export { collection_table_list_rslib_entry_ as default };
