using System.Windows;

namespace NexusShell.Services;

public static class NexusMotionPreferences
{
    public static bool ShouldReduceMotion()
    {
        try
        {
            if (!SystemParameters.ClientAreaAnimation)
            {
                return true;
            }

            var settings = App.Services.UserSettingsService.Current;
            return settings.PerformanceMode
                || string.Equals(settings.AnimationIntensity, "low", StringComparison.OrdinalIgnoreCase);
        }
        catch
        {
            return !SystemParameters.ClientAreaAnimation;
        }
    }

    public static bool PerformanceModeEnabled()
    {
        try
        {
            return App.Services.UserSettingsService.Current.PerformanceMode;
        }
        catch
        {
            return false;
        }
    }
}
