// EditorModeToggle.jsx
// Custom KendoReact component for switching between HTML and Markdown editing modes
import React from 'react';
import { Button } from '@progress/kendo-react-buttons';

function EditorModeToggle({ editMode, onToggle }) {
    return (
        // Toggle button positioned above the editor with consistent styling
        <div style={{
            display: 'flex',
            justifyContent: 'flex-end',
            marginBottom: '8px'
        }}>
            <Button
                onClick={onToggle}
                size="small"
                icon={editMode === 'html' ? 'code' : 'edit'}
            >
                {editMode === 'html' ? 'Switch to Markdown' : 'Switch to HTML'}
            </Button>
        </div>
    );
}

export default EditorModeToggle;
