use crate::class::Class;
use dioxus::prelude::*;
pub fn Textarea(props: TextareaProps) -> Element {
rsx! {
textarea {
class: props.class,
..props.attributes,
onchange: move |event| async move {
if let Some(handler) = props.on_change.as_ref() {
handler.call(event.value());
}
}
}
}
}
#[derive(Clone, PartialEq, Props)]
pub struct TextareaProps {
#[props(into, default = "textarea".into())]
pub class: Class,
pub on_change: Option<EventHandler<String>>,
#[props(extends = textarea)]
attributes: Vec<Attribute>,
}