/**
 * React Native Full App (https://store.enappd.com/product/react-native-full-app)
 *
 * Copyright © 2019-present Enappd. All rights reserved.
 *
 * This source code is licensed as per the terms found in the
 * LICENSE.md file in the root directory of this source tree.
 */
import React from 'react';
import { Card, CardItem, Body, Text, Button, H3, Col, Row } from 'native-base';

interface FaqCardProps {
    editEvent: (id:string) => void;
    deleteEvent: (id: string) => void;
    dataItem:any;
}

const FaqCard = (props:FaqCardProps) => (
    <Card>
        <CardItem>
            <Body>
                <H3>{props.dataItem.question}</H3>
            <Text>
                {props.dataItem.answer}
            </Text>
            </Body>
        </CardItem>
        <CardItem footer>
            <Row>
                <Col>
                    <Button full warning onPress={() => props.editEvent(props.dataItem.id)}>
                        <Text>Edit</Text>
                    </Button>
                </Col>
                <Col>
                    <Button full danger onPress={() => props.deleteEvent(props.dataItem.id)}>
                        <Text>Delete</Text>
                    </Button>
                </Col>
            </Row>
        </CardItem>
    </Card>
)

export default FaqCard;
