//
//  QRReadView.swift
//  forShip
//
//  Created by Mamoru Sugita on 2023/10/13.
//

import SwiftUI

struct QRReadView: View {
    @Binding var viewMode: LoginViewMode
    @ObservedObject private var viewModel = ScannerViewModel()
        
    var body: some View {
        //QR読み取りViewをセット：レイヤーにカメラプレビューのレイヤーをセット
        QrCodeScannerView()
            .found(r: self.viewModel.onFoundQrCode)
            .torchLight(isOn: self.viewModel.isShowing)
            .interval(delay: self.viewModel.scanInterval)
    }
}


#Preview {
    QRReadView(viewMode: .constant(.SelectType))
}
