@inject ILogger<ImportServiceStrongbox> Logger
@inject NavigationManager NavigationManager
@inject GlobalNotificationService GlobalNotificationService
@inject IStringLocalizerFactory LocalizerFactory
@using AliasVault.ImportExport.Models
@using AliasVault.ImportExport.Importers
@using Microsoft.Extensions.Localization

<ImportServiceCard
    ServiceName="Strongbox"
    Description="@Localizer["StrongboxDescription"]"
    LogoUrl="img/importers/strongbox.svg"
    ProcessFileCallback="ProcessFile">
    <p class="text-gray-700 dark:text-gray-300 mb-4">@Localizer["StrongboxInstructionsPart1"]</p>
    <p class="text-gray-700 dark:text-gray-300 mb-4">@Localizer["StrongboxInstructionsPart2"]</p>
</ImportServiceCard>

@code {
    private IStringLocalizer Localizer => LocalizerFactory.Create("Components.Main.Settings.ImportExport.ImportServices", "AliasVault.Client");

    private static async Task<List<ImportedCredential>> ProcessFile(string fileContents)
    {
        return await StrongboxImporter.ImportFromCsvAsync(fileContents);
    }
}
