mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-09-27 06:00:05 +00:00
27 lines
800 B
Swift
27 lines
800 B
Swift
import DesignSystem
|
|
import Env
|
|
import SwiftUI
|
|
|
|
struct StatusRowTagView: View {
|
|
@Environment(CurrentAccount.self) private var currentAccount
|
|
@Environment(RouterPath.self) private var routerPath
|
|
|
|
@Environment(\.isHomeTimeline) private var isHomeTimeline
|
|
|
|
let viewModel: StatusRowViewModel
|
|
|
|
var body: some View {
|
|
if isHomeTimeline,
|
|
let tag = viewModel.finalStatus.content.links.first(where: { link in
|
|
link.type == .hashtag && currentAccount.tags.contains(where: { $0.name.lowercased() == link.title.lowercased() })
|
|
}) {
|
|
Text("#\(tag.title)")
|
|
.font(.scaledFootnote)
|
|
.foregroundStyle(.secondary)
|
|
.fontWeight(.semibold)
|
|
.onTapGesture {
|
|
routerPath.navigate(to: .hashTag(tag: tag.title, account: nil))
|
|
}
|
|
}
|
|
}
|
|
}
|