diff --git a/app/src/main/java/com/tangem/tap/di/domain/AccountDomainModule.kt b/app/src/main/java/com/tangem/tap/di/domain/AccountDomainModule.kt
index 17e09eb709..8cf8edf8d6 100644
--- a/app/src/main/java/com/tangem/tap/di/domain/AccountDomainModule.kt
+++ b/app/src/main/java/com/tangem/tap/di/domain/AccountDomainModule.kt
@@ -1,10 +1,7 @@
package com.tangem.tap.di.domain
import com.tangem.domain.account.repository.AccountsCRUDRepository
-import com.tangem.domain.account.usecase.AddCryptoPortfolioUseCase
-import com.tangem.domain.account.usecase.ArchiveCryptoPortfolioUseCase
-import com.tangem.domain.account.usecase.RecoverCryptoPortfolioUseCase
-import com.tangem.domain.account.usecase.UpdateCryptoPortfolioUseCase
+import com.tangem.domain.account.usecase.*
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
@@ -44,4 +41,12 @@ internal object AccountDomainModule {
): RecoverCryptoPortfolioUseCase {
return RecoverCryptoPortfolioUseCase(crudRepository = accountsCRUDRepository)
}
+
+ @Provides
+ @Singleton
+ fun provideGetUnoccupiedAccountIndexUseCase(
+ accountsCRUDRepository: AccountsCRUDRepository,
+ ): GetUnoccupiedAccountIndexUseCase {
+ return GetUnoccupiedAccountIndexUseCase(crudRepository = accountsCRUDRepository)
+ }
}
\ No newline at end of file
diff --git a/core/res/src/main/res/values/strings.xml b/core/res/src/main/res/values/strings.xml
index 4089de8ca8..446bdcb138 100644
--- a/core/res/src/main/res/values/strings.xml
+++ b/core/res/src/main/res/values/strings.xml
@@ -18,6 +18,7 @@
Archive
You are archiving this account, but you can always get it back.
Account
+ Account #%s — used for address derivation.
Add account
Save
Account name
diff --git a/data/account/src/main/kotlin/com/tangem/data/account/repository/DefaultAccountsCRUDRepository.kt b/data/account/src/main/kotlin/com/tangem/data/account/repository/DefaultAccountsCRUDRepository.kt
index 723da17196..a46b5d096a 100644
--- a/data/account/src/main/kotlin/com/tangem/data/account/repository/DefaultAccountsCRUDRepository.kt
+++ b/data/account/src/main/kotlin/com/tangem/data/account/repository/DefaultAccountsCRUDRepository.kt
@@ -53,6 +53,12 @@ internal class DefaultAccountsCRUDRepository(
}
}
+ override suspend fun getTotalAccountsCount(userWalletId: UserWalletId): Int {
+ val activeAccountsCount = runtimeStore.getSyncOrNull()?.size ?: 1
+
+ return activeAccountsCount + 1
+ }
+
override fun getUserWallet(userWalletId: UserWalletId): UserWallet {
return userWalletsStore.getSyncStrict(userWalletId)
}
diff --git a/domain/account/src/main/java/com/tangem/domain/account/repository/AccountsCRUDRepository.kt b/domain/account/src/main/java/com/tangem/domain/account/repository/AccountsCRUDRepository.kt
index a32796f0a1..a05f267633 100644
--- a/domain/account/src/main/java/com/tangem/domain/account/repository/AccountsCRUDRepository.kt
+++ b/domain/account/src/main/java/com/tangem/domain/account/repository/AccountsCRUDRepository.kt
@@ -43,15 +43,20 @@ interface AccountsCRUDRepository {
*
* @param accountList the list of accounts to be saved.
*/
- @Throws
suspend fun saveAccounts(accountList: AccountList)
+ /**
+ * Retrieves the total count of accounts associated with a specific user wallet including archived accounts
+ *
+ * @param userWalletId the unique identifier of the user wallet
+ */
+ suspend fun getTotalAccountsCount(userWalletId: UserWalletId): Int
+
/**
* Retrieves a user wallet by its unique identifier
*
* @param userWalletId the unique identifier of the user wallet
* @return the [UserWallet] associated with the given identifier
*/
- @Throws
fun getUserWallet(userWalletId: UserWalletId): UserWallet
}
\ No newline at end of file
diff --git a/domain/account/src/main/java/com/tangem/domain/account/usecase/GetUnoccupiedAccountIndexUseCase.kt b/domain/account/src/main/java/com/tangem/domain/account/usecase/GetUnoccupiedAccountIndexUseCase.kt
new file mode 100644
index 0000000000..c34240e22b
--- /dev/null
+++ b/domain/account/src/main/java/com/tangem/domain/account/usecase/GetUnoccupiedAccountIndexUseCase.kt
@@ -0,0 +1,61 @@
+package com.tangem.domain.account.usecase
+
+import arrow.core.Either
+import arrow.core.getOrElse
+import arrow.core.raise.Raise
+import arrow.core.raise.catch
+import arrow.core.raise.either
+import com.tangem.domain.account.repository.AccountsCRUDRepository
+import com.tangem.domain.models.account.DerivationIndex
+import com.tangem.domain.models.wallet.UserWalletId
+
+/**
+ * Use case for retrieving the next unoccupied account index
+ *
+ * @property crudRepository repository for performing CRUD operations on accounts
+ *
+[REDACTED_AUTHOR]
+ */
+class GetUnoccupiedAccountIndexUseCase(
+ private val crudRepository: AccountsCRUDRepository,
+) {
+
+ /**
+ * Invokes the use case to calculate the next unoccupied account index
+ *
+ * @param userWalletId the unique identifier of the user wallet
+ */
+ suspend operator fun invoke(userWalletId: UserWalletId): Either = either {
+ val totalAccountsCount = getTotalAccountsCount(userWalletId = userWalletId)
+
+ DerivationIndex(totalAccountsCount + 1).getOrElse {
+ raise(Error.InvalidDerivationIndex(it))
+ }
+ }
+
+ private suspend fun Raise.getTotalAccountsCount(userWalletId: UserWalletId): Int {
+ return catch(
+ block = { crudRepository.getTotalAccountsCount(userWalletId = userWalletId) },
+ catch = { raise(Error.DataOperationFailed(cause = it)) },
+ )
+ }
+
+ /**
+ * Represents possible errors that can occur in the use case
+ */
+ sealed interface Error {
+
+ val tag: String
+ get() = this::class.simpleName ?: "GetUnoccupiedAccountIndexUseCase.Error"
+
+ /** Error indicating that the derivation index is invalid */
+ data class InvalidDerivationIndex(val cause: DerivationIndex.Error) : Error {
+ override fun toString(): String = "$tag: Invalid derivation index: $cause"
+ }
+
+ /** Error indicating that a data operation failed */
+ data class DataOperationFailed(val cause: Throwable) : Error {
+ override fun toString(): String = "$tag: Data operation failed: ${cause.message ?: "Unknown error"}"
+ }
+ }
+}
\ No newline at end of file
diff --git a/domain/account/src/test/kotlin/com/tangem/domain/account/usecase/GetUnoccupiedAccountIndexUseCaseTest.kt b/domain/account/src/test/kotlin/com/tangem/domain/account/usecase/GetUnoccupiedAccountIndexUseCaseTest.kt
new file mode 100644
index 0000000000..ec8af7f2b7
--- /dev/null
+++ b/domain/account/src/test/kotlin/com/tangem/domain/account/usecase/GetUnoccupiedAccountIndexUseCaseTest.kt
@@ -0,0 +1,59 @@
+package com.tangem.domain.account.usecase
+
+import arrow.core.left
+import arrow.core.right
+import com.google.common.truth.Truth
+import com.tangem.domain.account.repository.AccountsCRUDRepository
+import com.tangem.domain.models.wallet.UserWalletId
+import io.mockk.clearMocks
+import io.mockk.coEvery
+import io.mockk.coVerify
+import io.mockk.mockk
+import kotlinx.coroutines.test.runTest
+import org.junit.jupiter.api.BeforeEach
+import org.junit.jupiter.api.Test
+import org.junit.jupiter.api.TestInstance
+
+@TestInstance(TestInstance.Lifecycle.PER_CLASS)
+class GetUnoccupiedAccountIndexUseCaseTest {
+
+ private val crudRepository: AccountsCRUDRepository = mockk(relaxUnitFun = true)
+ private val useCase = GetUnoccupiedAccountIndexUseCase(crudRepository)
+ private val userWalletId = UserWalletId("011")
+
+ @BeforeEach
+ fun resetMocks() {
+ clearMocks(crudRepository)
+ }
+
+ @Test
+ fun `invoke should return next unoccupied index when repository returns count`() = runTest {
+ // Arrange
+ coEvery { crudRepository.getTotalAccountsCount(userWalletId) } returns 3
+
+ // Act
+ val actual = useCase(userWalletId = userWalletId)
+
+ // Assert
+ val expected = 4.right()
+ Truth.assertThat(actual).isEqualTo(expected)
+
+ coVerify { crudRepository.getTotalAccountsCount(userWalletId) }
+ }
+
+ @Test
+ fun `invoke should return error if repository throws exception`() = runTest {
+ // Arrange
+ val exception = IllegalStateException("Test error")
+ coEvery { crudRepository.getTotalAccountsCount(userWalletId) } throws exception
+
+ // Act
+ val actual = useCase(userWalletId = userWalletId)
+
+ // Assert
+ val expected = GetUnoccupiedAccountIndexUseCase.Error.DataOperationFailed(exception).left()
+ Truth.assertThat(actual).isEqualTo(expected)
+
+ coVerify { crudRepository.getTotalAccountsCount(userWalletId) }
+ }
+}
\ No newline at end of file
diff --git a/features/account/impl/build.gradle.kts b/features/account/impl/build.gradle.kts
index e68d20b144..dc77a38d28 100644
--- a/features/account/impl/build.gradle.kts
+++ b/features/account/impl/build.gradle.kts
@@ -20,6 +20,7 @@ dependencies {
implementation(projects.core.analytics.models)
implementation(projects.core.utils)
implementation(projects.core.ui)
+ implementation(projects.core.error)
implementation(projects.core.res)
implementation(projects.core.decompose)
implementation(projects.core.navigation)
diff --git a/features/account/impl/src/main/java/com/tangem/features/account/createedit/AccountCreateEditModel.kt b/features/account/impl/src/main/java/com/tangem/features/account/createedit/AccountCreateEditModel.kt
index b4763b9c92..0f5a66dedf 100644
--- a/features/account/impl/src/main/java/com/tangem/features/account/createedit/AccountCreateEditModel.kt
+++ b/features/account/impl/src/main/java/com/tangem/features/account/createedit/AccountCreateEditModel.kt
@@ -1,5 +1,7 @@
package com.tangem.features.account.createedit
+import com.tangem.core.analytics.api.AnalyticsExceptionHandler
+import com.tangem.core.analytics.models.ExceptionAnalyticsEvent
import com.tangem.core.decompose.di.ModelScoped
import com.tangem.core.decompose.model.Model
import com.tangem.core.decompose.model.ParamsContainer
@@ -9,11 +11,14 @@ import com.tangem.core.res.R
import com.tangem.core.ui.extensions.resourceReference
import com.tangem.core.ui.message.DialogMessage
import com.tangem.core.ui.message.EventMessageAction
+import com.tangem.core.ui.utils.showErrorDialog
import com.tangem.domain.account.usecase.AddCryptoPortfolioUseCase
+import com.tangem.domain.account.usecase.GetUnoccupiedAccountIndexUseCase
import com.tangem.domain.account.usecase.UpdateCryptoPortfolioUseCase
import com.tangem.domain.models.account.AccountName
import com.tangem.domain.models.account.CryptoPortfolioIcon
import com.tangem.domain.models.account.DerivationIndex
+import com.tangem.domain.models.wallet.UserWalletId
import com.tangem.features.account.AccountCreateEditComponent
import com.tangem.features.account.common.toDomain
import com.tangem.features.account.createedit.entity.AccountCreateEditUM
@@ -21,15 +26,20 @@ import com.tangem.features.account.createedit.entity.AccountCreateEditUMBuilder
import com.tangem.features.account.createedit.entity.AccountCreateEditUMBuilder.Companion.portfolioIcon
import com.tangem.features.account.createedit.entity.AccountCreateEditUMBuilder.Companion.updateButton
import com.tangem.features.account.createedit.entity.AccountCreateEditUMBuilder.Companion.updateColorSelect
+import com.tangem.features.account.createedit.entity.AccountCreateEditUMBuilder.Companion.updateDerivationIndex
import com.tangem.features.account.createedit.entity.AccountCreateEditUMBuilder.Companion.updateIconSelect
import com.tangem.features.account.createedit.entity.AccountCreateEditUMBuilder.Companion.updateName
+import com.tangem.features.account.createedit.error.AccountFeatureError
import com.tangem.utils.coroutines.CoroutineDispatcherProvider
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
+import kotlinx.coroutines.flow.update
import kotlinx.coroutines.launch
+import timber.log.Timber
import javax.inject.Inject
@ModelScoped
+@Suppress("LongParameterList")
internal class AccountCreateEditModel @Inject constructor(
paramsContainer: ParamsContainer,
private val messageSender: UiMessageSender,
@@ -37,13 +47,21 @@ internal class AccountCreateEditModel @Inject constructor(
override val dispatchers: CoroutineDispatcherProvider,
private val updateCryptoPortfolioUseCase: UpdateCryptoPortfolioUseCase,
private val addCryptoPortfolioUseCase: AddCryptoPortfolioUseCase,
+ private val getUnoccupiedAccountIndexUseCase: GetUnoccupiedAccountIndexUseCase,
+ private val analyticsExceptionHandler: AnalyticsExceptionHandler,
) : Model() {
private val params = paramsContainer.require()
private val umBuilder = AccountCreateEditUMBuilder(params)
- val uiState: StateFlow get() = _uiState
- private val _uiState = MutableStateFlow(value = getInitialState())
+ val uiState: StateFlow
+ field = MutableStateFlow(value = getInitialState())
+
+ init {
+ if (params is AccountCreateEditComponent.Params.Create) {
+ updateDerivationInfo(userWalletId = params.userWalletId)
+ }
+ }
private fun unsaveChangeDialog() {
val secondAction = EventMessageAction(
@@ -74,13 +92,16 @@ internal class AccountCreateEditModel @Inject constructor(
private suspend fun createNewCryptoPortfolio(params: AccountCreateEditComponent.Params.Create) {
val state = uiState.value
- val name = AccountName(state.account.name).getOrNull() ?: return
+ val name = AccountName(value = state.account.name).getOrNull() ?: return
val icon = state.account.portfolioIcon.toDomain()
+ val index = state.account.derivationInfo.index ?: return
+ val derivationIndex = DerivationIndex(value = index).getOrNull() ?: return
+
addCryptoPortfolioUseCase(
userWalletId = params.userWalletId,
accountName = name,
icon = icon,
- derivationIndex = DerivationIndex.Main, // todo account
+ derivationIndex = derivationIndex,
)
}
@@ -100,19 +121,19 @@ internal class AccountCreateEditModel @Inject constructor(
private fun onCloseClick() = unsaveChangeDialog()
private fun onIconSelect(icon: CryptoPortfolioIcon.Icon) {
- _uiState.value = uiState.value
+ uiState.value = uiState.value
.updateIconSelect(icon)
.validateNewState()
}
private fun onColorSelect(color: CryptoPortfolioIcon.Color) {
- _uiState.value = uiState.value
+ uiState.value = uiState.value
.updateColorSelect(color)
.validateNewState()
}
private fun onNameChange(name: String) {
- _uiState.value = uiState.value
+ uiState.value = uiState.value
.updateName(name)
.validateNewState()
}
@@ -140,4 +161,35 @@ internal class AccountCreateEditModel @Inject constructor(
onCloseClick = ::onCloseClick,
)
}
+
+ private fun updateDerivationInfo(userWalletId: UserWalletId) {
+ modelScope.launch(dispatchers.default) {
+ getUnoccupiedAccountIndexUseCase(userWalletId = userWalletId)
+ .onRight { derivationIndex ->
+ uiState.update {
+ it.updateDerivationIndex(derivationIndex = derivationIndex.value)
+ }
+ }
+ .onLeft {
+ handleError(
+ error = AccountFeatureError.CreateAccount.UnableToGetDerivationIndex,
+ params = mapOf("userWalletId" to userWalletId.stringValue),
+ )
+
+ return@launch
+ }
+ }
+ }
+
+ private fun handleError(error: AccountFeatureError, params: Map = mapOf()) {
+ val exception = IllegalStateException(error.toString())
+
+ Timber.e(exception)
+
+ analyticsExceptionHandler.sendException(
+ event = ExceptionAnalyticsEvent(exception = exception, params = params),
+ )
+
+ messageSender.showErrorDialog(universalError = error, onDismiss = router::pop)
+ }
}
\ No newline at end of file
diff --git a/features/account/impl/src/main/java/com/tangem/features/account/createedit/entity/AccountCreateEditUM.kt b/features/account/impl/src/main/java/com/tangem/features/account/createedit/entity/AccountCreateEditUM.kt
index 4b133a4d97..df93dde4b9 100644
--- a/features/account/impl/src/main/java/com/tangem/features/account/createedit/entity/AccountCreateEditUM.kt
+++ b/features/account/impl/src/main/java/com/tangem/features/account/createedit/entity/AccountCreateEditUM.kt
@@ -17,11 +17,23 @@ data class AccountCreateEditUM(
data class Account(
val name: String,
val portfolioIcon: CryptoPortfolioIconUM,
- val derivationInfo: TextReference,
+ val derivationInfo: DerivationInfo,
val inputPlaceholder: TextReference,
val onNameChange: (String) -> Unit,
)
+ sealed interface DerivationInfo {
+ val text: TextReference
+ val index: Int?
+
+ data class Content(override val text: TextReference, override val index: Int) : DerivationInfo
+
+ data object Empty : DerivationInfo {
+ override val text: TextReference = TextReference.EMPTY
+ override val index: Int? = null
+ }
+ }
+
data class Colors(
val selected: CryptoPortfolioIcon.Color,
val list: ImmutableList,
diff --git a/features/account/impl/src/main/java/com/tangem/features/account/createedit/entity/AccountCreateEditUMBuilder.kt b/features/account/impl/src/main/java/com/tangem/features/account/createedit/entity/AccountCreateEditUMBuilder.kt
index 41f12322bb..bacbd306ab 100644
--- a/features/account/impl/src/main/java/com/tangem/features/account/createedit/entity/AccountCreateEditUMBuilder.kt
+++ b/features/account/impl/src/main/java/com/tangem/features/account/createedit/entity/AccountCreateEditUMBuilder.kt
@@ -3,15 +3,15 @@ package com.tangem.features.account.createedit.entity
import com.tangem.core.res.R
import com.tangem.core.ui.extensions.TextReference
import com.tangem.core.ui.extensions.resourceReference
+import com.tangem.core.ui.extensions.wrappedList
import com.tangem.domain.models.account.Account
import com.tangem.domain.models.account.CryptoPortfolioIcon
import com.tangem.features.account.AccountCreateEditComponent
import com.tangem.features.account.common.toUM
import kotlinx.collections.immutable.toImmutableList
-import javax.inject.Inject
-internal class AccountCreateEditUMBuilder @Inject constructor(
- val params: AccountCreateEditComponent.Params,
+internal class AccountCreateEditUMBuilder(
+ private val params: AccountCreateEditComponent.Params,
) {
private val accountColors = CryptoPortfolioIcon.Color.entries.toImmutableList()
@@ -29,14 +29,16 @@ internal class AccountCreateEditUMBuilder @Inject constructor(
is AccountCreateEditComponent.Params.Create -> AccountCreateEditUM.Account(
name = "",
portfolioIcon = createIcon,
- derivationInfo = TextReference.EMPTY,
+ derivationInfo = AccountCreateEditUM.DerivationInfo.Empty,
inputPlaceholder = resourceReference(R.string.account_form_placeholder_new_account),
onNameChange = onNameChange,
)
is AccountCreateEditComponent.Params.Edit -> AccountCreateEditUM.Account(
name = params.account.name.value,
portfolioIcon = params.account.portfolioIcon.toUM(),
- derivationInfo = TextReference.EMPTY, // todo account use Account.CryptoPortfolio.derivationIndex ?
+ derivationInfo = createAccountDerivationInfo(
+ index = (params.account as Account.CryptoPortfolio).derivationIndex.value,
+ ),
inputPlaceholder = resourceReference(R.string.account_form_placeholder_edit_account),
onNameChange = onNameChange,
)
@@ -113,5 +115,25 @@ internal class AccountCreateEditUMBuilder @Inject constructor(
fun AccountCreateEditUM.updateButton(isButtonEnabled: Boolean): AccountCreateEditUM {
return this.copy(buttonState = this.buttonState.copy(isButtonEnabled = isButtonEnabled))
}
+
+ fun AccountCreateEditUM.updateDerivationIndex(derivationIndex: Int): AccountCreateEditUM {
+ return this.copy(
+ account = this.account.copy(
+ derivationInfo = createAccountDerivationInfo(index = derivationIndex),
+ ),
+ )
+ }
+
+ private fun createAccountDerivationInfo(index: Int): AccountCreateEditUM.DerivationInfo {
+ val derivationIndexText = if (index.toString().length == 1) "0$index" else "$index"
+
+ return AccountCreateEditUM.DerivationInfo.Content(
+ text = resourceReference(
+ id = R.string.account_form_account_index,
+ formatArgs = wrappedList(derivationIndexText),
+ ),
+ index = index,
+ )
+ }
}
}
\ No newline at end of file
diff --git a/features/account/impl/src/main/java/com/tangem/features/account/createedit/error/AccountFeatureError.kt b/features/account/impl/src/main/java/com/tangem/features/account/createedit/error/AccountFeatureError.kt
new file mode 100644
index 0000000000..9ab8549fc7
--- /dev/null
+++ b/features/account/impl/src/main/java/com/tangem/features/account/createedit/error/AccountFeatureError.kt
@@ -0,0 +1,30 @@
+package com.tangem.features.account.createedit.error
+
+import com.tangem.core.error.UniversalError
+
+sealed interface AccountFeatureError : UniversalError {
+
+ val subsystemCode: String
+ val specificErrorCode: String
+
+ override val errorCode: Int
+ get() = "108$subsystemCode$specificErrorCode".toInt()
+
+ sealed interface CreateAccount : AccountFeatureError {
+
+ override val subsystemCode: String get() = "001"
+
+ data object UnableToGetDerivationIndex : CreateAccount {
+ override val specificErrorCode: String = "001"
+ }
+ }
+
+ sealed interface EditAccount : AccountFeatureError {
+
+ override val subsystemCode: String get() = "002"
+
+ data object RequiredCryptoPortfolio : EditAccount {
+ override val specificErrorCode: String = "001"
+ }
+ }
+}
\ No newline at end of file
diff --git a/features/account/impl/src/main/java/com/tangem/features/account/createedit/ui/AccountCreateEditContent.kt b/features/account/impl/src/main/java/com/tangem/features/account/createedit/ui/AccountCreateEditContent.kt
index 2f98a553bc..b94e9198fe 100644
--- a/features/account/impl/src/main/java/com/tangem/features/account/createedit/ui/AccountCreateEditContent.kt
+++ b/features/account/impl/src/main/java/com/tangem/features/account/createedit/ui/AccountCreateEditContent.kt
@@ -32,10 +32,7 @@ import com.tangem.core.ui.components.SpacerH24
import com.tangem.core.ui.components.SpacerH8
import com.tangem.core.ui.components.appbar.AppBarWithBackButton
import com.tangem.core.ui.components.fields.AutoSizeTextField
-import com.tangem.core.ui.extensions.resolveReference
-import com.tangem.core.ui.extensions.resourceReference
-import com.tangem.core.ui.extensions.stringReference
-import com.tangem.core.ui.extensions.stringResourceSafe
+import com.tangem.core.ui.extensions.*
import com.tangem.core.ui.res.TangemTheme
import com.tangem.core.ui.res.TangemThemePreview
import com.tangem.domain.models.account.CryptoPortfolioIcon
@@ -76,7 +73,7 @@ internal fun AccountCreateEditContent(state: AccountCreateEditUM, modifier: Modi
SpacerH8()
Text(
modifier = Modifier.padding(horizontal = 8.dp),
- text = state.account.derivationInfo.resolveReference(),
+ text = state.account.derivationInfo.text.resolveReference(),
style = TangemTheme.typography.caption2,
color = TangemTheme.colors.text.tertiary,
)
@@ -93,7 +90,7 @@ internal fun AccountCreateEditContent(state: AccountCreateEditUM, modifier: Modi
}
@Composable
-private fun AccountSummary(account: AccountCreateEditUM.Account) {
+private fun AccountSummary(account: Account) {
Column(
modifier = Modifier
.clip(RoundedCornerShape(16.dp))
@@ -126,7 +123,7 @@ private fun AccountSummary(account: AccountCreateEditUM.Account) {
}
@Composable
-private fun AccountIcon(account: AccountCreateEditUM.Account) {
+private fun AccountIcon(account: Account) {
Box(
contentAlignment = Alignment.Center,
modifier = Modifier
@@ -308,7 +305,10 @@ private class PreviewStateProvider : CollectionPreviewParameterProvider