//
//  ToggleView.swift
//  ArkitDoushiQi
//
//  Created by Johan LACHENAL on 21/05/2024.
//

import SwiftUI

struct ToggleComponent: View {
    @AppStorage("isDarkMode") private var isDarkMode = false
    var body: some View {
       Divider().background(Color.gray).padding(.vertical, 1)
          Toggle("Dark Mode", isOn: $isDarkMode)
                .toggleStyle(SwitchToggleStyle(tint: .blue))
                .padding(EdgeInsets(top: 0, leading: 48, bottom: 0, trailing: 48))
        Divider().background(Color.gray).padding(.vertical, 1)
    }
}

struct ToggleComponent_Previews: PreviewProvider {
    static var previews: some View {
        VStack{
        ToggleComponent()
        }
    }
}
