mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
24 lines
547 B
Rust
24 lines
547 B
Rust
use mlua::TableExt;
|
|
use ratatui::widgets::Widget;
|
|
use tracing::error;
|
|
|
|
use super::{layout, COMP_STATUS};
|
|
use crate::layout::Rect;
|
|
|
|
pub struct Status<'a> {
|
|
cx: &'a yazi_core::Ctx,
|
|
}
|
|
|
|
impl<'a> Status<'a> {
|
|
#[inline]
|
|
pub fn new(cx: &'a yazi_core::Ctx) -> Self { Self { cx } }
|
|
}
|
|
|
|
impl<'a> Widget for Status<'a> {
|
|
fn render(self, area: ratatui::prelude::Rect, buf: &mut ratatui::prelude::Buffer) {
|
|
let mut f = || layout(COMP_STATUS.call_method::<_, _>("render", Rect(area))?, self.cx, buf);
|
|
if let Err(e) = f() {
|
|
error!("{:?}", e);
|
|
}
|
|
}
|
|
}
|