/* Copyright (C) Click & Push Accessibility, Inc - All Rights Reserved
 * Unauthorized copying of this file, via any medium is strictly prohibited
 * Proprietary and confidential
 * Written and maintained by the Click & Push Development team 
 * <dev@clicknpush.ca>, January 2022
 */

import React from "react"
import { 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>
    )
}