import React from "react"
import { TouchableOpacity, Text } from "react-native"
import { TouchableHighlight } from "react-native-gesture-handler"
import { ProfileSectionStyles } from "../Styles/ProfileSections.styles"

interface SectionHeaderProps {
    isCollapsed: boolean
    collapseToggleMethod: () => void
    title: string
}

export const ProfileSectionHeader: React.FC<SectionHeaderProps> = ({isCollapsed, collapseToggleMethod, title}) => {    
    return (
        <TouchableHighlight 
            underlayColor="#F0F0F0"
            style={[ProfileSectionStyles.profileSectionContainer, !isCollapsed ? ProfileSectionStyles.profileSectionContainerSelected : null]} 
            onPress={collapseToggleMethod}>
            <Text style={[!isCollapsed ? {fontWeight: 'bold'} : null, ProfileSectionStyles.profileSectionTitle]}>{title}</Text>
        </TouchableHighlight>
    )
}