tauri_plugin_picoframe_hello/
lib.rs1use picoframe_core::CliResult;
5use serde_json::json;
6use tauri::{
7 plugin::{Builder, TauriPlugin},
8 Runtime,
9};
10
11#[tauri::command]
12async fn hello_greet(name: String) -> CliResult {
13 let name = if name.trim().is_empty() { "world".to_string() } else { name };
14 CliResult::ok(json!({ "message": format!("Hello, {name}!") }))
15}
16
17pub fn init<R: Runtime>() -> TauriPlugin<R> {
20 Builder::new("picoframe-hello")
21 .invoke_handler(tauri::generate_handler![hello_greet])
22 .build()
23}