import React from 'react'
import { View } from 'react-native'
import { OButton } from '../shared'
import Intercom from '@intercom/intercom-react-native'
import { useLanguage } from 'ordering-components-Ubanku-Custom/native'

export const IntercomChat = () => {
    const [, t] = useLanguage()
    
    const handleOpenChat = () => {
        Intercom.displayMessenger()
    }

    return (
        <View>
            <OButton
                text={t('OPEN_CHAT', 'Open chat')}
                onClick={() => handleOpenChat()}
            />
        </View>
    )
}
