IceCubesApp/Packages/Notifications/Sources/Notifications/NotificationsHeaderFilteredView.swift
Thomas Ricouard c3edabb183 Lint
2024-05-04 13:19:19 +02:00

40 lines
1.2 KiB
Swift

import DesignSystem
import Env
import Models
import SwiftUI
struct NotificationsHeaderFilteredView: View {
@Environment(Theme.self) private var theme
@Environment(RouterPath.self) private var routerPath
let filteredNotifications: NotificationsPolicy.Summary
var body: some View {
if let count = Int(filteredNotifications.pendingNotificationsCount), count > 0 {
HStack {
Label("notifications.content-filter.requests.title", systemImage: "archivebox")
.foregroundStyle(.secondary)
Spacer()
Text(filteredNotifications.pendingNotificationsCount)
.font(.footnote)
.fontWeight(.semibold)
.monospacedDigit()
.foregroundStyle(theme.primaryBackgroundColor)
.padding(8)
.background(.secondary)
.clipShape(Circle())
Image(systemName: "chevron.right")
.foregroundStyle(.secondary)
}
.onTapGesture {
routerPath.navigate(to: .notificationsRequests)
}
.listRowBackground(theme.secondaryBackgroundColor)
.listRowInsets(.init(top: 12,
leading: .layoutPadding,
bottom: 12,
trailing: .layoutPadding))
}
}
}