|
- import BusX
- import SwiftUI
-
- extension MicItem {
- public struct V: View {
- var id: String?
- @StateObject var isActive = BusUI.Value(Mic.K.isActive, false)
-
- public init(_ id: String? = nil) {
- self.id = id
- }
-
- public var body: some View {
- Text("Mic activity")
- .padding(8)
- .border(
- isActive.v ? Color.black : Color.gray,
- width: isActive.v ? 3 : 1
- )
- .animation(.easeInOut(duration: 0.3))
- .onAppear {
- isActive.id = id
- }
- .onChange(of: id) { newValue in
- isActive.id = newValue
- }
- }
- }
- }
|