iOS/Sources/Shared/DesignSystem/Components/SettingsButton.swift
Bruno Pantaleão Gonçalves 1623da6625
Migrate servers selection bottom sheet to swiftUI (#3545)
<!-- Thank you for submitting a Pull Request and helping to improve Home
Assistant. Please complete the following sections to help the processing
and review of your changes. Please do not delete anything from this
template. -->

## Summary
<!-- Provide a brief summary of the changes you have made and most
importantly what they aim to achieve -->

## Screenshots
![Simulator Screenshot - iPhone 16 Plus - 2025-04-15 at 13 27
19](https://github.com/user-attachments/assets/1c0cb20d-2561-4956-a7de-e406443c17e0)
2025-04-15 14:02:09 +02:00

33 lines
723 B
Swift

import SwiftUI
public struct SettingsButton: View {
private let action: () -> Void
private let tint: Color
public init(tint: Color = Color.gray, action: @escaping (() -> Void)) {
self.action = action
self.tint = tint
}
public var body: some View {
Button(action: {
action()
}, label: {
Image(
uiImage: MaterialDesignIcons.cogIcon.image(
ofSize: .init(width: 25, height: 25), color: UIColor(tint)
)
)
})
}
}
#Preview {
VStack {
SettingsButton {}
.frame(maxWidth: .infinity, alignment: .trailing)
.padding()
Spacer()
}
}