// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the Apache 2.0 License
// See the LICENSE file in the project root for more information.
// Maintainer: Argo Zhang(argo@live.ca) Website: https://www.blazor.zone

namespace BootstrapBlazor.Server.Components.Samples;

/// <summary>
/// ClockPicker 组件示例代码
/// </summary>
public partial class ClockPickers
{
    [Inject]
    [NotNull]
    private IStringLocalizer<ClockPickers>? Localizer { get; set; }

    private TimeSpan Value { get; set; } = DateTime.Now - DateTime.Today;

    private TimeSpan SecondValue { get; set; } = TimeSpan.FromHours(12.5);

    private TimeSpan MinuteValue { get; set; } = TimeSpan.FromHours(12);

    private TimeSpan ScaleValue { get; set; } = TimeSpan.FromHours(12.5);

    private bool _autoSwitch = false;

    private AttributeItem[] GetAttributes() =>
    [
        new()
        {
            Name = nameof(ClockPicker.IsAutoSwitch),
            Description = Localizer["IsAutoSwitchAttr"],
            Type = "bool",
            ValueList = "true / false",
            DefaultValue = "true"
        },
        new()
        {
            Name = nameof(ClockPicker.ShowClockScale),
            Description = Localizer["ShowClockScaleAttr"],
            Type = "bool",
            ValueList = "true / false",
            DefaultValue = "false"
        },
        new()
        {
            Name = nameof(ClockPicker.ShowMinute),
            Description = Localizer["ShowMinuteAttr"],
            Type = "bool",
            ValueList = "true / false",
            DefaultValue = "true"
        },
        new()
        {
            Name = nameof(ClockPicker.ShowSecond),
            Description = Localizer["ShowSecondAttr"],
            Type = "bool",
            ValueList = "true / false",
            DefaultValue = "true"
        }
    ];
}
