"""Praise templates for fallback mode."""

PRAISE_TEMPLATES = {
    "clean_commit": [
        "✨ Beautiful commit! Clear message, focused changes, and just the right size. You're a git wizard! 🧙‍♂️",
        "🎯 PERFECTION! This is exactly how commits should look. Keep this standard up! 👑",
        "💎 A gem of a commit! Clean, descriptive, and well-scoped. This is chef's kiss! 👨‍🍳💋",
        "🌟 Outstanding work! Your commit message tells a story and your changes are surgical. Bravo! 👏",
    ],
    
    "good_message": [
        "📝 That commit message is *chef's kiss*! Clear, concise, and informative. Nice work! 🎉",
        "✅ Love the detailed commit message! Future you will thank present you. Great practice! 🙌",
        "💬 Your commit message game is STRONG! This is how you document changes properly! 📚",
    ],
    
    "test_included": [
        "🧪 Tests included? You absolute legend! That's how we write reliable code! 💪",
        "✅ Testing your code like a pro! Your future self will thank you when bugs don't appear! 🛡️",
        "🎯 Tests AND features? Now that's what I call comprehensive! Keep it up! 🚀",
    ],
    
    "refactor": [
        "♻️ Refactoring done right! Cleaning up the codebase like a true craftsperson! 🔧",
        "✨ That refactor is *smooth*! Code quality just went up a notch! 📈",
        "🧹 Love a good cleanup! Your codebase is looking fresher than ever! 🌟",
    ],
    
    "bug_fix": [
        "🐛 Bug squashed! Your debugging skills are on point! 💥",
        "🔨 Fixed it! Every bug you crush makes the codebase stronger! 💪",
        "🎯 Bug fix delivered! You're keeping the app running smooth! 🚀",
    ],
    
    "feature": [
        "🚀 New feature deployed! Innovation in action! Keep building! 🏗️",
        "✨ Feature added! Your users are going to love this! 💝",
        "🎉 Shipping features like a boss! This is what progress looks like! 📦",
    ],
    
    "focused": [
        "🎯 Laser-focused commit! One thing at a time, done right. This is the way! ⭐",
        "👌 Perfect scope! You're not trying to boil the ocean in one commit. Smart! 🧠",
        "💡 Focused and purposeful! This is textbook commit discipline! 📖",
    ],
    
    "documentation": [
        "📚 Documentation update! The unsung hero of codebases! Thank you! 🙏",
        "✍️ Docs updated! Helping future developers understand the code. True hero! 🦸",
        "📖 Documentation love! This makes everyone's life easier! 💚",
    ],
    
    "small_improvement": [
        "💎 Small but mighty! Every little improvement counts! Keep polishing! ✨",
        "🎨 Nice touch! These small improvements add up to greatness! 🌟",
        "⚡ Quick win! Small optimizations lead to big improvements over time! 📈",
    ],
    
    "consistent_work": [
        "🔥 Consistent commits! You're building momentum and it shows! 💪",
        "📈 Steady progress! This is how successful projects are built! 🏗️",
        "⚡ You're on a roll! Keep that coding energy flowing! 🌊",
    ],
    
    "default": [
        "👏 Good work! Every commit moves the project forward! 🚀",
        "✅ Committed and deployed! Your contribution matters! 🌟",
        "💪 Keep it up! Building great things one commit at a time! 🏗️",
        "🎯 Solid work! You're making progress and that's what counts! 📈",
    ]
}


def get_praise_category(commit_data: dict) -> str:
    """Determine the praise category based on commit data."""
    message = commit_data.get("message", "").lower()
    lines_changed = commit_data.get("lines_added", 0) + commit_data.get("lines_deleted", 0)
    files_changed = commit_data.get("files_changed", 0)
    is_clean = commit_data.get("is_clean", False)
    
    # Check for specific keywords in message
    if any(word in message for word in ["test", "spec", "unittest"]):
        return "test_included"
    
    if any(word in message for word in ["refactor", "cleanup", "clean up"]):
        return "refactor"
    
    if any(word in message for word in ["fix", "bug", "issue", "resolve"]):
        return "bug_fix"
    
    if any(word in message for word in ["feat", "feature", "add", "implement"]):
        return "feature"
    
    if any(word in message for word in ["doc", "readme", "comment"]):
        return "documentation"
    
    # Check for clean commit characteristics
    if is_clean and lines_changed < 200 and files_changed <= 5:
        return "clean_commit"
    
    # Good message but maybe larger scope
    if is_clean:
        return "good_message"
    
    # Small improvements
    if lines_changed < 50:
        return "small_improvement"
    
    # Focused work
    if files_changed <= 3:
        return "focused"
    
    return "default"
