import React, { useEffect, FunctionComponent, useContext } from 'react';
import { View, ViewStyle } from 'react-native';
import styles from './PixelForumAnswerComponentStyles';
import usePixelForumAnswerComponentTranslation from './PixelForumAnswerComponentTranslation'
import { PixelStyles } from 'react-native-pixel-styles';
import { ForumUserInfos } from '../ForumUserInfos/ForumUserInfos';
import { PixelForumAnswer } from '../../Model/PixelForumAnswer';

interface IProps {
    // Props type definition
    style?: ViewStyle | ViewStyle[]
    answer: PixelForumAnswer
}

interface IState {
    // State type definition
}

export const PixelForumAnswerComponent: FunctionComponent<IProps> = (props) => {

    const { I18n } = usePixelForumAnswerComponentTranslation()
    const themeStore = useContext(PixelStyles.pixelThemeStoreContext)

    const initialState: IState = {
    };

    // ComponentDidMount
    useEffect(() => {
        return () => {
            //ComponentDidUnmount
        }
    }, [])

    return (
        <View style={[styles.centeredColumn, styles.fullContainer]} >
            <ForumUserInfos user={props.answer.author} />
        </View>
    );
};
