| | | 1 | | using Pomodoro.Web.Models; |
| | | 2 | | |
| | | 3 | | namespace Pomodoro.Web.Services; |
| | | 4 | | |
| | | 5 | | /// <summary> |
| | | 6 | | /// Interface for consent modal operations |
| | | 7 | | /// </summary> |
| | | 8 | | public interface IConsentService |
| | | 9 | | { |
| | | 10 | | event Action? OnConsentRequired; |
| | | 11 | | event Action? OnCountdownTick; |
| | | 12 | | event Action? OnConsentHandled; |
| | | 13 | | |
| | | 14 | | bool IsModalVisible { get; } |
| | | 15 | | SessionType CompletedSessionType { get; } |
| | | 16 | | int CountdownSeconds { get; } |
| | | 17 | | List<ConsentOption> AvailableOptions { get; } |
| | | 18 | | |
| | | 19 | | void Initialize(); |
| | | 20 | | void ShowConsentModal(SessionType completedSessionType); |
| | | 21 | | void HideConsentModal(); |
| | | 22 | | void RefreshOptions(); |
| | | 23 | | Task SelectOptionAsync(SessionType nextSessionType); |
| | | 24 | | Task HandleTimeoutAsync(); |
| | | 25 | | } |
| | | 26 | | |
| | | 27 | | /// <summary> |
| | | 28 | | /// Represents an option in the consent modal |
| | | 29 | | /// </summary> |
| | | 30 | | public class ConsentOption |
| | | 31 | | { |
| | 445 | 32 | | public SessionType SessionType { get; set; } |
| | 819 | 33 | | public string Label { get; set; } = string.Empty; |
| | 816 | 34 | | public string Duration { get; set; } = string.Empty; |
| | 402 | 35 | | public bool IsDefault { get; set; } |
| | | 36 | | } |