//  OpenHaystack – Tracking personal Bluetooth devices via Apple's Find My network
//
//  Copyright © 2021 Secure Mobile Networking Lab (SEEMOO)
//  Copyright © 2021 The Open Wireless Link Project
//
//  SPDX-License-Identifier: AGPL-3.0-only

import AppKit
import Foundation
import SwiftUI

final class ActivityIndicator: NSViewRepresentable {

    init(size: NSControl.ControlSize) {
        self.size = size
    }

    let size: NSControl.ControlSize

    typealias NSViewType = NSProgressIndicator

    func makeNSView(context: Context) -> NSProgressIndicator {
        let indicator = NSProgressIndicator()
        indicator.style = .spinning
        indicator.controlSize = self.size
        indicator.startAnimation(nil)
        return indicator
    }

    func updateNSView(_ nsView: NSProgressIndicator, context: Context) {

    }

}
