import SwiftUI

struct StateAccentModifier: ViewModifier {
    let color: Color

    func body(content: Content) -> some View {
        content
            .overlay(alignment: .leading) {
                RoundedRectangle(cornerRadius: 1.5)
                    .fill(color)
                    .frame(width: 3)
                    .padding(.vertical, 4)
                    .offset(x: -12)
            }
    }
}

extension View {
    func stateAccent(_ color: Color) -> some View {
        modifier(StateAccentModifier(color: color))
    }
}
