using NexusShell.Models;

namespace NexusShell.Services;

public sealed class NexusBluetoothService
{
    private readonly NexusBluetoothInfoService _bluetoothInfo;

    public NexusBluetoothService(NexusBluetoothInfoService bluetoothInfo)
    {
        _bluetoothInfo = bluetoothInfo;
    }

    public (string Status, IReadOnlyList<NexusBluetoothDeviceInfo> Devices) Capture()
    {
        var snapshot = _bluetoothInfo.Capture();
        var devices = snapshot.PairedDevices
            .Select(static name => new NexusBluetoothDeviceInfo { Name = name })
            .ToList();

        return (snapshot.Status, devices);
    }
}
