import React from "react"
import { API_URL } from "../utils/RequestUtils"
import * as WebBrowser from 'expo-web-browser'
import { TouchableOpacity, Text } from "react-native"
import { ProfileMainStyles } from "./Profile/Styles/Profile.styles"

export const PrivacyLink: React.FC = () => {
    /**
     * Opens up the company privacy policy in the browser.
     */
    const openPrivacyPolicy = async () => {
        await WebBrowser.openBrowserAsync(API_URL + "/privacy")
    }

    return (
        <TouchableOpacity onPress={openPrivacyPolicy}>
            <Text style={ProfileMainStyles.privacyButtonText}>Privacy policy</Text>
        </TouchableOpacity>
    )
}