action_card!() { /* proc-macro */ }
Expand description
Proc-macro to make construct SampleActionCard more convernient.
§Example
// accept a const tuple as action button
const ACTION_BTN: (&str, &str) = ("btn_title", "btn_url");
// also accept function return tuple
fn DYNAMIC_BTN(p: &str) -> (&'static str, String) {
("btn_title", format!("btn_url_dynamic_{p}"))
}
action_card! {
"Card Title",
format!("card text"),
[ACTION_BTN, (DYNAMIC_BTN("something"))]
}