import SwiftUI

extension View {
    func placeholder<T: View>(when predicate: Bool, @ViewBuilder content: () -> T) -> some View {
        ZStack {
            content().opacity(predicate ? 1 : 0)
            self
        }
        .animation(.default, value: predicate)
    }
}
