import type { ButtonConfig } from '../../../index.type';
import type { BimEngine } from '../../../../../bim-engine';
import { infoIcon } from './icon';

/**
 * 信息按钮配置
 * 说明：当前仍保留 demo 的事件触发方式；engine 已注入，便于未来替换为 SDK 内部逻辑。
 */
export const createInfoButton = (_engine: BimEngine): ButtonConfig => {
    return {
        id: 'toolbar-info',
        groupId: 'group-2',
        type: 'button',
        label: 'toolbar.info',
        icon: infoIcon,
        onClick: () => {
            // WORKAROUND: Dispatch a standard custom event on document
            document.dispatchEvent(new CustomEvent('bim-demo:open-property-panel'));
        }
    };
};
