using ClaudeDo.Data.Models;
using CommunityToolkit.Mvvm.ComponentModel;

namespace ClaudeDo.Ui.ViewModels.Modals.Settings;

public sealed partial class GeneralSettingsTabViewModel : ViewModelBase
{
    [ObservableProperty] private string _defaultClaudeInstructions = "";
    [ObservableProperty] private string _defaultModel = ModelRegistry.DefaultAlias;
    [ObservableProperty] private int _defaultMaxTurns = 100;
    [ObservableProperty] private string _defaultPermissionMode = PermissionModeRegistry.DefaultMode;

    public IReadOnlyList<string> Models { get; } = ModelRegistry.Aliases;
    public IReadOnlyList<string> PermissionModes { get; } = PermissionModeRegistry.Modes;

    public string? Validate()
    {
        if (DefaultMaxTurns < 1 || DefaultMaxTurns > 200)
            return "Max turns must be between 1 and 200.";
        return null;
    }
}
