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

/**
 * 轴向剖切按钮配置
 */
export const createSectionAxisButton = (engine: BimEngine): ButtonConfig => {
    return {
        id: 'section-axis',
        groupId: 'group-1',
        parentId: 'section',
        type: 'button',
        keepActive: true,
        exclusive: true,
        align: 'vertical',
        label: 'toolbar.sectionAxis',
        icon: '<svg width="32" height="32" viewBox="0 0 24 24"><circle cx="12" cy="12" r="6" fill="currentColor"/></svg>',
        onClick: (button) => {
            if (button.isActive) {
                engine.sectionAxis?.show();
            } else {
                engine.sectionAxis?.destroy();
            }
        }
    };
};
