using FrontOffice.Main.Utilities;

namespace FrontOffice.Main.Pages;

public partial class Licenses
{
    private bool _loading = true;
    private PageSettingsDto? _pageData;
    private List<PageSettingsImageDto> _licenseImages = new();

    protected override async Task OnInitializedAsync()
    {
        try
        {
            _pageData = await PageSettingsService.GetPageAsync("licenses");

            if (_pageData != null)
            {
                _licenseImages = _pageData.GetImages("licenses");
            }
        }
        catch
        {
            // Fallback: page remains null → hardcoded content will render
        }
        finally
        {
            _loading = false;
        }
    }
}
