//
//  TabItemModifier.swift
//  PadelClub
//
//  Created by Razmig Sarkissian on 02/04/2024.
//

import SwiftUI

struct TabItemModifier: ViewModifier {
    let tabDestination: TabDestination
    
    func body(content: Content) -> some View {
        content
            .tabItem {
                Label(tabDestination.title, systemImage: tabDestination.image)
            }
            .tag(tabDestination as TabDestination?)
    }
}

extension View {
    func tabItem(for tabDestination: TabDestination) -> some View {
        modifier(TabItemModifier(tabDestination: tabDestination))
    }
}
