import React from 'react'; import { View, Text, StyleSheet, TouchableOpacity } from 'react-native'; import { Task } from '../types/task'; interface TaskCardProps { task: Task; onPress: (id: string) => void; } const TaskCard: React.FC = ({ task, onPress }) => { return ( onPress(task.id)}> {task.name} 状态: {task.status} ); }; const styles = StyleSheet.create({ card: { backgroundColor: '#fff', borderRadius: 8, padding: 16, margin: 8, width: '45%', elevation: 3, shadowColor: '#000', shadowOffset: { width: 0, height: 2 }, shadowOpacity: 0.1, shadowRadius: 2, }, title: { fontSize: 16, fontWeight: 'bold', marginBottom: 8, }, status: { fontSize: 14, color: '#666', }, }); export default TaskCard;