import React, { Component } from 'react';
import { TouchableOpacity } from 'react-native';
import { View, Text } from 'native-base';
import { reminderDelete } from './../actions'
import { connect } from 'react-redux';
import moment from 'moment';

class ReminderListItem extends Component {

    constructor(props) {
        super(props)
    }

    deleteAppointment(id) {
        this.props.reminderDelete(id)
    }

    render() {
        return (
            <TouchableOpacity onPress={() => this.deleteAppointment(this.props.data.id)}>
                <View>
                    <Text>{this.props.data.medName}</Text>
                    <Text>{this.props.data.reminderTime}</Text>
                    <Text>{this.props.data.meal}</Text>
                    <Text>{this.props.data.period}</Text>
                    <Text>{this.props.data.dose}</Text>
                </View>
            </TouchableOpacity>
        )
    }
}

export default connect(null, { reminderDelete })(ReminderListItem);