//! `InputGroup`: an input with inline text or icons inside one bordered control.
use dioxus::prelude::*;
use crate::class::compose;
/// Props for [`InputGroup`].
#[derive(Props, Clone, PartialEq)]
pub struct InputGroupProps {
/// Extra classes appended after the Lumen class.
#[props(into)]
pub class: Option<String>,
/// Any other `<div>` or global attribute.
#[props(extends = GlobalAttributes, extends = div)]
pub attributes: Vec<Attribute>,
/// The control plus leading or trailing text (`span`, `strong`), icons, or buttons.
pub children: Element,
}
/// Wraps an input with inline prefixes or suffixes, such as a currency sign, a unit, or an icon,
/// inside one bordered control.
#[component]
pub fn InputGroup(props: InputGroupProps) -> Element {
let class = compose([Some("ui-input-group"), props.class.as_deref()]);
rsx! {
div { class, ..props.attributes, {props.children} }
}
}