/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 *
 * @format
 */

import {
  Button,
  StatusBar,
  StyleSheet,
  Text,
  useColorScheme,
  View,
} from 'react-native';
import { showMessage } from '@common/ToastHelper.ts';
import Toast from 'react-native-toast-message';
import Alert from '@common/components/Alert.tsx';
import { NavigationPop } from '@common/NavigationHelper.ts';
import { versionName } from '@ywx/ywq.ts';

function YwqMain() {
  const isDarkMode = useColorScheme() === 'dark';

  return (
    <View style={styles.container}>
      <StatusBar barStyle={isDarkMode ? 'light-content' : 'dark-content'} />
      <View style={{ height: 100 }} />
      <Text>医网签{versionName}</Text>
      <Button
        title={'onConfirm'}
        onPress={() => {
          Alert.show('hello Alert', undefined, {
            action: () => {
              NavigationPop();
            },
          });
        }}
      />
      <View style={{ height: 15 }} />
      <Button
        title={'Toast'}
        onPress={() => {
          showMessage('医网签弹出toast-error', 'error');
        }}
      />
      <Toast />
      {/*<Alert ref={ref => Alert.setRef(ref)} />*/}
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
  },
});

export default YwqMain;
