//
//  LocalWebView.swift
//  Sailassist
//
//  Created by 三浦薫巳 on 2023/12/22.
//

import SwiftUI

struct LocalWebView: View {
    @Binding var policy: Policy
    var body: some View {
        VStack{
            if policy == .TermsOfUse {
                if let htmlPath = Bundle.main.path(forResource: "terms", ofType: "html") {
                    WebView(isLoading: .constant(false), url: htmlPath)
                }
            } else {
                if let htmlPath = Bundle.main.path(forResource: "privacy", ofType: "html") {
                    WebView(isLoading: .constant(false), url: htmlPath)
                }
            }

            Spacer()
        }
        .background(ColorSet.BackgroundPrimary.color)
    }
}

#Preview {
    LocalWebView(policy: .constant(.TermsOfUse))
}
