//! Button component with variants and states
//!
//! Follows L-COMPONENT-PROPS and L-COMPONENT-REUSE patterns.
//! Supports primary, secondary, and danger variants with loading state.

/// Generate button HTML
///
/// Creates a button with the specified label and variant.
/// Variants: "primary", "secondary", "danger"
pub fn button_html(label: &str, variant: &str, disabled: bool) -> String {
    let class = match variant {
        "secondary" => "px-4 py-2 rounded-md text-sm font-medium text-gray-700 bg-white border border-gray-300 hover:bg-gray-50",
        "danger" => "px-4 py-2 rounded-md text-sm font-medium text-white bg-red-600 hover:bg-red-700",
        _ => "px-4 py-2 rounded-md text-sm font-medium text-white bg-blue-600 hover:bg-blue-700",
    };

    let disabled_attr = if disabled {
        " opacity-50 cursor-not-allowed"
    } else {
        ""
    };

    format!(
        r#"<button class="{}{} transition-colors" {}>{}</button>"#,
        class,
        disabled_attr,
        if disabled { "disabled" } else { "" },
        label
    )
}
