// Copyright (c) 2026 Modelware. All rights reserved.

import { BaseMarkdownBlockRenderer } from './renderer.js';
import type { MdBlockExecutionResult } from './types.js';

export class MessageMarkdownBlockRenderer extends BaseMarkdownBlockRenderer {
    canRender(_result: MdBlockExecutionResult): boolean {
        return true;
    }

    render(result: MdBlockExecutionResult): HTMLElement {
        const container = this.createResultContainer(result.status);
        const text = result.message ?? (result.status === 'unimplemented' ? 'Not implemented.' : 'Execution failed.');
        container.appendChild(this.createMessageContainer(text));
        return container;
    }
}

