var __assign = (this && this.__assign) || function () {
    __assign = Object.assign || function(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                t[p] = s[p];
        }
        return t;
    };
    return __assign.apply(this, arguments);
};
import { jsx as _jsx } from "react/jsx-runtime";
import Preview from 'preview';
import { initChainStyles } from 'config/stylebook';
var AppOptions = {
    version: 'widget/v1',
    kind: 'Application',
    metadata: {
        name: 'subscan widget',
    },
    spec: {
        components: [
            {
                id: 'title1',
                type: 'core/v1/title',
                properties: {
                    text: '{{JSON.stringify(graphQL0.data)}}',
                },
                traits: [
                    {
                        type: 'core/v1/event',
                        properties: {
                            handlers: [
                                {
                                    type: '$onMount',
                                    componentId: 'api0',
                                    method: {
                                        name: 'triggerFetch',
                                        parameters: {},
                                    },
                                    wait: {
                                        type: 'debounce',
                                        time: 0,
                                    },
                                    disabled: false,
                                },
                            ],
                        },
                    },
                ],
            },
            {
                id: 'graphQL0',
                type: 'core/v1/dummy',
                properties: {},
                traits: [
                    {
                        type: 'core/v1/graphQL',
                        properties: {
                            url: 'https://api.subquery.network/sq/itering/multisig-polkadot',
                            query: 'query {\n    approveRecords (first: 5) {\n        nodes {\n            id\n            multisigRecordId\n            account\n            approveTimepoint\n        }\n    }\n    multisigRecords (first: 5) {\n        nodes {\n            id\n            createExtrinsicIdx\n            module\n            method\n        }\n    }\n}',
                            variables: '{{{}}}',
                            key: 'value',
                        },
                    },
                ],
            },
        ],
    },
};
export default {
    title: 'Subscan Lib/DataSource GraphQL',
    component: Preview,
    layout: 'fullscreen',
};
var Template = function (args) { return _jsx(Preview, __assign({}, args)); };
export var Index = Template.bind({});
Index.args = __assign({ options: AppOptions }, initChainStyles);
