use std::fs; use std::path::Path; pub fn write_dynamic_component(name: &str, code: &str) -> std::io::Result<()> { let dir = Path::new("./frontend/src/dynamic"); if !dir.exists() { fs::create_dir_all(dir)?; } let file_path = dir.join(format!("{}.tsx", name)); fs::write(file_path, code) }