use ratatui::Frame;
use ratatui::layout::Rect;
use super::theme::*;
use tui_line_editor::EditorTheme;
pub(crate) use tui_line_editor::{Editor, apply_edit_key};
fn editor_theme(th: &Theme) -> EditorTheme {
EditorTheme {
text: th.text,
panel: th.panel,
dim: th.dim,
select_fg: th.select_fg,
select_bg: th.select_bg,
}
}
pub(crate) fn render_editor(f: &mut Frame, area: Rect, ed: &Editor, masked: bool, th: &Theme) {
tui_line_editor::render_editor(f, area, ed, &editor_theme(th), masked);
}
pub(crate) fn render_line_field(
f: &mut Frame,
area: Rect,
ed: &Editor,
focused: bool,
mask: bool,
th: &Theme,
) {
tui_line_editor::render_line_field(f, area, ed, &editor_theme(th), focused, mask);
}