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

import SwiftUI

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


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