use std::{fs::write, path::PathBuf};

use eframe::egui::{Color32, Frame, Stroke};

pub fn a(f: &dyn AsRef<[u8]>, path: PathBuf) {
    write(path, f).expect("");
}

pub fn frame(active: bool) -> eframe::egui::Frame {
    let s_width = if active { 2. } else { 1. };
    let color = if active {
        Color32::BLUE
    } else {
        Color32::BLACK
    };
    let stroke = Stroke::new(s_width, color);
    Frame::new()
        .stroke(stroke)
        .inner_margin(10.)
        .outer_margin(10.)
        .corner_radius(1.0)
}