// Firmware View Component
class FirmwareViewComponent extends Component {
    constructor(container, viewModel, eventBus) {
        super(container, viewModel, eventBus);
        
        logger.debug('FirmwareViewComponent: Constructor called');
        logger.debug('FirmwareViewComponent: Container:', container);
        
        // Pass the entire firmware view container to the FirmwareComponent
        logger.debug('FirmwareViewComponent: Using entire container for FirmwareComponent');
        
        this.firmwareComponent = new FirmwareComponent(
            container,
            viewModel,
            eventBus
        );
        
        logger.debug('FirmwareViewComponent: FirmwareComponent created');
    }

    mount() {
        super.mount();
        
        logger.debug('FirmwareViewComponent: Mounting...');
        
        // Mount sub-component
        this.firmwareComponent.mount();
        
        logger.debug('FirmwareViewComponent: Mounted successfully');
    }

    unmount() {
        // Unmount sub-component
        if (this.firmwareComponent) {
            this.firmwareComponent.unmount();
        }
        
        super.unmount();
    }

    // Override pause method to handle sub-components
    onPause() {
        logger.debug('FirmwareViewComponent: Pausing...');
        
        // Pause sub-component
        if (this.firmwareComponent && this.firmwareComponent.isMounted) {
            this.firmwareComponent.pause();
        }
    }

    // Override resume method to handle sub-components
    onResume() {
        logger.debug('FirmwareViewComponent: Resuming...');
        
        // Resume sub-component
        if (this.firmwareComponent && this.firmwareComponent.isMounted) {
            this.firmwareComponent.resume();
        }
    }

    // Override to determine if re-render is needed on resume
    shouldRenderOnResume() {
        // Don't re-render on resume - maintain current state
        return false;
    }

} 