//! AnimatedIconType enum for registry-based animated icon lookup
//!
//! This module provides a Copy-able enum representing all available animated icons.
//! Used for zero-allocation registry lookup following the same pattern as regular icons.
//!
//! 🤖 AUTO-GENERATED FILE - DO NOT EDIT MANUALLY
//! Generated by: generate_animated_icon_type_enum.py

use std::fmt;

/// Copy-able enum representing all available animated icons for registry lookup
///
/// This enum enables O(1) icon lookup in the static registry without
/// any runtime string parsing or allocation.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum AnimatedIconType {
    Heart,
    Plus,
}

impl AnimatedIconType {
    /// Get all available animated icon types
    pub fn all() -> &'static [AnimatedIconType] {
        &[AnimatedIconType::Heart, AnimatedIconType::Plus]
    }

    /// Get the component name for this icon type
    pub fn component_name(&self) -> &'static str {
        match self {
            AnimatedIconType::Heart => "HeartAnimate",
            AnimatedIconType::Plus => "PlusAnimate",
        }
    }

    /// Get the snake_case name for this icon type
    pub fn snake_name(&self) -> &'static str {
        match self {
            AnimatedIconType::Heart => "heart",
            AnimatedIconType::Plus => "plus",
        }
    }
}

impl fmt::Display for AnimatedIconType {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        write!(f, "{}", self.component_name())
    }
}

/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/*                        🧪 TESTS 🧪                         */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn test_animated_icon_type_all() {
        let all_icons = AnimatedIconType::all();
        assert_eq!(all_icons.len(), 2);
        assert!(all_icons.contains(&AnimatedIconType::Heart));
        assert!(all_icons.contains(&AnimatedIconType::Plus));
    }

    #[test]
    fn test_animated_icon_type_component_names() {
        assert_eq!(AnimatedIconType::Heart.component_name(), "HeartAnimate");
        assert_eq!(AnimatedIconType::Plus.component_name(), "PlusAnimate");
    }

    #[test]
    fn test_animated_icon_type_snake_names() {
        assert_eq!(AnimatedIconType::Heart.snake_name(), "heart");
        assert_eq!(AnimatedIconType::Plus.snake_name(), "plus");
    }

    #[test]
    fn test_animated_icon_type_display() {
        assert_eq!(format!("{}", AnimatedIconType::Heart), "HeartAnimate");
        assert_eq!(format!("{}", AnimatedIconType::Plus), "PlusAnimate");
    }

    #[test]
    fn test_animated_icon_type_copy() {
        let heart = AnimatedIconType::Heart;
        let heart_copy = heart;

        // Both should be identical and usable
        assert_eq!(heart, heart_copy);
        assert_eq!(heart.component_name(), heart_copy.component_name());
    }

    #[test]
    fn test_animated_icon_type_eq_hash() {
        use std::collections::HashSet;

        let mut set = HashSet::new();
        set.insert(AnimatedIconType::Heart);
        set.insert(AnimatedIconType::Plus);
        set.insert(AnimatedIconType::Heart); // Duplicate

        // Should only have 2 unique items
        assert_eq!(set.len(), 2);
        assert!(set.contains(&AnimatedIconType::Heart));
        assert!(set.contains(&AnimatedIconType::Plus));
    }
}
