|
@@ -0,0 +1,40 @@
|
|
|
+package com.example.myapplication.view.theme.MainActivity.components
|
|
|
+
|
|
|
+import android.content.SharedPreferences.Editor
|
|
|
+import android.util.Log
|
|
|
+import androidx.compose.foundation.lazy.LazyColumn
|
|
|
+import androidx.compose.foundation.lazy.items
|
|
|
+import androidx.compose.runtime.Composable
|
|
|
+import androidx.compose.runtime.LaunchedEffect
|
|
|
+import androidx.compose.runtime.getValue
|
|
|
+import androidx.compose.runtime.mutableStateOf
|
|
|
+import androidx.compose.runtime.remember
|
|
|
+import androidx.compose.runtime.setValue
|
|
|
+import com.example.myapplication.domain.utils.Constant
|
|
|
+import com.example.myapplication.models.Editors
|
|
|
+import io.github.jan.supabase.postgrest.from
|
|
|
+import io.github.jan.supabase.storage.BucketItem
|
|
|
+import kotlinx.coroutines.Dispatchers
|
|
|
+import kotlinx.coroutines.withContext
|
|
|
+
|
|
|
+@Composable
|
|
|
+fun EditorList(){
|
|
|
+ var editors by remember { mutableStateOf<List<Editors>>(listOf()) }
|
|
|
+ var bucket: ByteArray? = null
|
|
|
+ var bytes:ByteArray? = null
|
|
|
+ var files: List<BucketItem>? = null
|
|
|
+ LaunchedEffect(Unit) {
|
|
|
+ withContext(Dispatchers.IO){
|
|
|
+ editors = Constant.supabase.from("editors").select().decodeList<Editors>()
|
|
|
+ editors.forEach{it-> Log.d("C",it.name)}
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ LazyColumn {
|
|
|
+ items(
|
|
|
+ editors,
|
|
|
+ key = {editors -> editors.id},
|
|
|
+ ){}
|
|
|
+ }
|
|
|
+}
|