~ knotless Search/
↑↓ move↵ open⇧↵ all results

geesawra.industries/old-fella

Old people's social media app

0
1
main
32 lines · 1.1 KB Raw History
import SwiftUI

struct PeopleListRows: View {
    @AppStorage("handlesOnly") private var handlesOnly = false

    let accounts: [Post.Author]
    let rowIdentifierPrefix: String
    let openProfile: (String) -> Void

    var body: some View {
        ForEach(accounts) { author in
            let open = { openProfile(author.id) }
            AccountSummaryRow(
                author: author, bio: author.bio,
                avatarIdentifier: "\(rowIdentifierPrefix)Avatar-\(author.id)",
                contentIdentifier: "\(rowIdentifierPrefix)-\(author.id)",
                openProfile: open
            ) {
                VStack(alignment: .leading, spacing: 3) {
                    Text(DisplayPreferences(handlesOnly: handlesOnly).name(author))
                        .appFont(.headline).foregroundStyle(.primary)
                    if !handlesOnly {
                        Text("@\(author.handle)").appFont(.subheadline).foregroundStyle(.secondary)
                    }
                }
            }
            .modifier(ContentListRowStyle(openPost: open))
            .listRowInsets(EdgeInsets())
            .listRowSeparator(.hidden)
        }
    }
}