use arboard::Clipboard;

/// Copy text to the system clipboard via arboard.
#[tauri::command]
pub fn copy_to_clipboard(text: String) -> Result<(), String> {
    let mut clipboard = Clipboard::new().map_err(|e| format!("Clipboard init failed: {e}"))?;
    clipboard
        .set_text(&text)
        .map_err(|e| format!("Clipboard write failed: {e}"))?;
    Ok(())
}
