import React from 'react'; import { Linking, ScrollView, StyleSheet, Text, TouchableOpacity, View } from 'react-native'; import { Item } from 'types/Item'; type MainContentProps = { selected: string; onToggleMenu: () => void; data: Item[]; }; export default function MainContent({ selected, onToggleMenu, data }: MainContentProps) { const getTitle = () => { switch (selected) { case 'home': return 'Welcome to Home!'; case 'royal-road': return 'Royal Road Updates'; case 'podcasts': return 'Latest Podcasts'; case 'mixtapes': return 'Mixtapes'; default: return ''; } }; return ( {getTitle()} {data.map(item => ( Linking.openURL(item.link)}> {item.title} {item.info} ))} ); } const styles = StyleSheet.create({ mainContent: { flex: 1, justifyContent: 'center', alignItems: 'center', position: 'relative', backgroundColor: '#f2f2f2', }, menuButton: { position: 'absolute', top: 40, left: 16, zIndex: 1, backgroundColor: '#333', borderRadius: 20, padding: 8, }, menuButtonText: { color: '#fff', fontSize: 24, }, title: { fontSize: 24, fontWeight: 'bold', color: '#333', marginTop: 60, marginBottom: 16, }, dataContainer: { width: '90%', }, dataItem: { backgroundColor: '#fff', borderRadius: 8, padding: 16, marginBottom: 12, shadowColor: '#000', shadowOpacity: 0.05, shadowRadius: 4, elevation: 2, }, dataTitle: { fontSize: 18, fontWeight: 'bold', color: '#222', marginBottom: 4, }, dataDescription: { fontSize: 15, color: '#555', }, });