import { SimpleCodeBlock } from 'ui-patterns/SimpleCodeBlock' import type { ContentFileProps } from '@/components/interfaces/Connect/Connect.types' import { ConnectTabContent, ConnectTabs, ConnectTabTrigger, ConnectTabTriggers, } from '@/components/interfaces/Connect/ConnectTabs' const ContentFile = ({ projectKeys }: ContentFileProps) => { return ( {` @Serializable data class TodoItem(val id: Int, val name: String) `} {` val briven = createBrivenClient( brivenUrl = "${projectKeys.apiUrl ?? 'your-project-url'}", brivenKey = "${projectKeys.publishableKey ?? ''}" ) { install(Postgrest) } class MainActivity : ComponentActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContent { MaterialTheme { // A surface container using the 'background' color from the theme Surface( modifier = Modifier.fillMaxSize(), color = MaterialTheme.colorScheme.background ) { TodoList() } } } } } @Composable fun TodoList() { var items by remember { mutableStateOf>(listOf()) } LaunchedEffect(Unit) { withContext(Dispatchers.IO) { items = briven.from("todos") .select().decodeList() } } LazyColumn { items( items, key = { item -> item.id }, ) { item -> Text( item.name, modifier = Modifier.padding(8.dp), ) } } } `} ) } export default ContentFile