import React from 'react'; import { View, Text, TouchableOpacity, StyleSheet, Modal } from 'react-native'; import { Ionicons } from '@expo/vector-icons'; const RoleSelector = ({ visible, onClose, selectedRole, onSelectRole }) => { const roles = [ { id: 'authority', label: 'Authority', icon: 'shield-checkmark', color: '#2563EB', description: 'Centralized platform access' }, { id: 'trainer', label: 'Trainer', icon: 'school', color: '#059669', description: 'Conduct and manage trainings' }, { id: 'trainee', label: 'Trainee', icon: 'person', color: '#7C3AED', description: 'Attend trainings and get certificates' }, ]; return ( Select Role {roles.map((role) => ( { onSelectRole(role.id); onClose(); }} > {role.label} {role.description} {selectedRole === role.id && ( )} ))} ); }; const styles = StyleSheet.create({ overlay: { flex: 1, backgroundColor: 'rgba(0, 0, 0, 0.5)', justifyContent: 'center', alignItems: 'center', padding: 20, }, menuContainer: { backgroundColor: '#FFFFFF', borderRadius: 20, width: '100%', maxWidth: 400, padding: 20, shadowColor: '#000', shadowOffset: { width: 0, height: 10 }, shadowOpacity: 0.25, shadowRadius: 20, elevation: 10, }, menuHeader: { flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', marginBottom: 20, }, menuTitle: { fontSize: 20, fontWeight: '700', color: '#1E293B', }, roleOption: { flexDirection: 'row', alignItems: 'center', padding: 16, borderRadius: 12, marginBottom: 12, borderWidth: 2, borderColor: '#E2E8F0', backgroundColor: '#FFFFFF', }, roleOptionSelected: { borderColor: '#2563EB', backgroundColor: '#EFF6FF', }, roleIcon: { width: 56, height: 56, borderRadius: 28, justifyContent: 'center', alignItems: 'center', marginRight: 16, }, roleContent: { flex: 1, }, roleLabel: { fontSize: 18, fontWeight: '600', color: '#1E293B', marginBottom: 4, }, roleDescription: { fontSize: 13, color: '#64748B', }, }); export default RoleSelector;