From a6f3068728affc3a24549f40aadd7cd0795b1b57 Mon Sep 17 00:00:00 2001 From: Thomas Ricouard Date: Wed, 8 May 2024 10:59:31 +0200 Subject: [PATCH] Add accounts list placeholder --- .../AccountsList/AccountsListView.swift | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/Packages/Account/Sources/Account/AccountsList/AccountsListView.swift b/Packages/Account/Sources/Account/AccountsList/AccountsListView.swift index ed916294..2623da4d 100644 --- a/Packages/Account/Sources/Account/AccountsList/AccountsListView.swift +++ b/Packages/Account/Sources/Account/AccountsList/AccountsListView.swift @@ -124,16 +124,23 @@ public struct AccountsListView: View { } } Section { - ForEach(accounts) { account in - if let relationship = relationships.first(where: { $0.id == account.id }) { - AccountsListRow(viewModel: .init(account: account, - relationShip: relationship)) - #if !os(visionOS) - .listRowBackground(theme.primaryBackgroundColor) - #endif + if accounts.isEmpty { + PlaceholderView(iconName: "person.icloud", + title: "No accounts found", + message: "This list of accounts is empty") + .listRowSeparator(.hidden) + } else { + ForEach(accounts) { account in + if let relationship = relationships.first(where: { $0.id == account.id }) { + AccountsListRow(viewModel: .init(account: account, + relationShip: relationship)) + } } } } + #if !os(visionOS) + .listRowBackground(theme.primaryBackgroundColor) + #endif switch nextPageState { case .hasNextPage: