use termimad::MadSkin;
use termimad::gray;
pub fn create_matrixcode_skin() -> MadSkin {
let mut skin = MadSkin::default();
skin.headers[0]
.compound_style
.set_fg(termimad::crossterm::style::Color::Cyan);
skin.headers[0].add_attr(termimad::crossterm::style::Attribute::Bold);
skin.headers[1]
.compound_style
.set_fg(termimad::crossterm::style::Color::DarkCyan);
skin.headers[1].add_attr(termimad::crossterm::style::Attribute::Bold);
skin.headers[2]
.compound_style
.set_fg(termimad::crossterm::style::Color::Yellow);
skin.bold.set_fg(termimad::crossterm::style::Color::White);
skin.bold
.add_attr(termimad::crossterm::style::Attribute::Bold);
skin.inline_code
.set_fg(termimad::crossterm::style::Color::Yellow);
skin.inline_code.set_bg(gray(20));
skin.code_block.set_fg(gray(15));
skin.code_block.set_bg(gray(5));
skin.italic.set_fg(gray(12));
skin
}
pub fn print_markdown(text: &str) {
let skin = create_matrixcode_skin();
skin.print_text(text);
}
pub fn print_response_border(title: &str, text: &str) {
if !text.contains("<thinking>") && !text.starts_with("Let me") && !text.starts_with("I need to")
{
println!();
println!("📝 {}:", title);
print_separator();
print_markdown(text);
print_separator();
}
}
pub fn print_thinking_border(text: &str) {
println!();
println!("💭 Thinking:");
print_separator();
let clean_text = text.replace("<thinking>", "").replace("</thinking>", "");
println!("{}", clean_text.trim());
print_separator();
}
pub fn print_separator() {
println!("─{}", "─".repeat(40));
}