import {
ActivityIndicator,
FlatList,
Pressable,
StyleSheet,
Text,
View,
} from 'react-native';
import { useReservations } from '@/features/reservations/hooks/useReservations';
export default function ReservationsScreen() {
const { reservations, loading, error, reload } = useReservations();
if (loading) {
return (
);
}
if (error) {
return (
{error}
Reintentar
);
}
return (
Mis reservas
item.id}
contentContainerStyle={styles.list}
ListEmptyComponent={
No tienes reservas todavĂa
}
renderItem={({ item }) => (
{item.officeName}
Fecha: {item.date}
Inicio: {item.startTime}
Fin: {item.endTime}
)}
/>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
padding: 16,
},
center: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
padding: 24,
},
title: {
fontSize: 28,
fontWeight: '700',
marginBottom: 16,
},
list: {
gap: 12,
},
card: {
borderWidth: 1,
borderColor: '#ddd',
borderRadius: 12,
padding: 16,
gap: 6,
},
cardTitle: {
fontSize: 18,
fontWeight: '600',
},
error: {
color: 'red',
marginBottom: 12,
},
button: {
backgroundColor: '#1f6feb',
paddingHorizontal: 16,
paddingVertical: 12,
borderRadius: 10,
},
buttonText: {
color: '#fff',
fontWeight: '600',
},
empty: {
color: '#666',
},
});