AsssistantScreen.kt 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * Nextcloud Android client application
  3. *
  4. * @author Alper Ozturk
  5. * Copyright (C) 2024 Alper Ozturk
  6. * Copyright (C) 2024 Nextcloud GmbH
  7. *
  8. * This program is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU Affero General Public License as published by
  10. * the Free Software Foundation, either version 3 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU Affero General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU Affero General Public License
  19. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  20. */
  21. package com.nextcloud.client.assistant
  22. import androidx.compose.foundation.ExperimentalFoundationApi
  23. import androidx.compose.foundation.layout.Box
  24. import androidx.compose.foundation.layout.fillMaxSize
  25. import androidx.compose.foundation.layout.padding
  26. import androidx.compose.foundation.lazy.LazyColumn
  27. import androidx.compose.foundation.lazy.items
  28. import androidx.compose.foundation.lazy.itemsIndexed
  29. import androidx.compose.material3.Scaffold
  30. import androidx.compose.material3.Text
  31. import androidx.compose.runtime.Composable
  32. import androidx.compose.runtime.collectAsState
  33. import androidx.compose.runtime.getValue
  34. import androidx.compose.ui.Modifier
  35. import androidx.compose.ui.unit.dp
  36. @OptIn(ExperimentalFoundationApi::class)
  37. @Composable
  38. fun AssistantScreen(viewModel: AssistantViewModel) {
  39. val taskTypes by viewModel.taskTypes.collectAsState()
  40. LazyColumn(modifier = Modifier.fillMaxSize().padding(16.dp)) {
  41. items(taskTypes?.ocs?.data?.types ?: listOf()) {
  42. Text(text = it.toString())
  43. }
  44. }
  45. }