import React from 'react';
import { StyleSheet, View } from 'react-native';
import { useFonts } from 'expo-font';
import AppLoading from 'expo-app-loading';
import { PxEntryPoint } from '@proximus/react-native-common-ui/lib/entryPoints';
import { IconFont } from '@proximus/react-native-common-ui/lib/links/PxIcon';
import { Nucleo } from '@proximus/react-native-font-icons';

export default function App() {
  const [loaded] = useFonts({
    'Proximus-Bold': require('@proximus/react-native-font-icons/lib/assets/fonts/Proximus-Bold.ttf'),
    'Proximus-Regular': require('@proximus/react-native-font-icons/lib/assets/fonts/Proximus-Regular.ttf'),
    Proximus: require('@proximus/react-native-font-icons/lib/assets/fonts/Proximus-Regular.ttf'),
  });

  if (!loaded) {
    return <AppLoading />;
  }

  return (
    <View style={styles.container}>
      <View style={styles.viewRow}>
        <PxEntryPoint
          title={'Entry point label'}
          subTitle={'From €11.90 €5.95/month'}
          onPress={() => {}}
          iconFont={IconFont.NUCLEO}
          icon={Nucleo.TV}
        />
      </View>
      <View style={styles.viewRow}>
        <PxEntryPoint
          title={'Entry point Emphasis'}
          subTitle={'From €11.90 €5.95/month'}
          onPress={() => {}}
          emphasis
          iconFont={IconFont.NUCLEO}
          icon={Nucleo.SmartHome}
        />
      </View>
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: '#fff',
    justifyContent: 'center',
    alignItems: 'center',
    padding: 20,
  },
  viewRow: {
    marginBottom: 10,
    width: '100%',
  },
});
