Files
ProxyIOS/UI/SharedComponents/FilterChipsView.swift
Trey t 148bc3887c Add iPad support, auto-pinning, and comprehensive logging
- Adaptive iPhone/iPad layout with NavigationSplitView sidebar
- Auto-detect SSL-pinned domains, fall back to passthrough
- Certificate install via local HTTP server (Safari profile flow)
- App Group-backed CA, per-domain leaf cert LRU cache
- DB-backed config repository, Darwin notification throttling
- Rules engine, breakpoint rules, pinned domain tracking
- os.Logger instrumentation across tunnel/proxy/mitm/capture/cert/rules/db/ipc/ui
- Fix dyld framework embed, race conditions, thread safety
2026-04-11 12:52:18 -05:00

51 lines
1.8 KiB
Swift

import SwiftUI
struct FilterChip: Identifiable, Equatable {
let id = UUID()
let label: String
var isSelected: Bool = false
}
struct FilterChipsView: View {
@Binding var chips: [FilterChip]
var body: some View {
ScrollView(.horizontal, showsIndicators: false) {
HStack(spacing: 8) {
ForEach($chips) { $chip in
Button {
withAnimation(.spring(response: 0.24, dampingFraction: 0.9)) {
chip.isSelected.toggle()
}
} label: {
HStack(spacing: 6) {
if chip.isSelected {
Image(systemName: "checkmark")
.font(.caption2.weight(.bold))
}
Text(chip.label)
.font(.caption.weight(.semibold))
}
.padding(.horizontal, 14)
.padding(.vertical, 9)
.background(
chip.isSelected ? Color.accentColor.opacity(0.16) : Color(.systemBackground),
in: Capsule()
)
.overlay(
Capsule()
.stroke(
chip.isSelected ? Color.accentColor.opacity(0.35) : Color.primary.opacity(0.06),
lineWidth: 1
)
)
.foregroundStyle(chip.isSelected ? Color.accentColor : .primary)
}
.buttonStyle(.plain)
}
}
.padding(.vertical, 2)
}
}
}