import React, { useEffect } from 'react';
import { StatusBar, useColorScheme, SafeAreaView } from 'react-native';
import { showPluginUI } from 'QmsPlugin';

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

  useEffect(() => {
    console.log('🚀 Launching plugin UI immediately...');
    try {
      showPluginUI();
    } catch (e) {
      console.error('❌ Error launching plugin UI:', e);
    }
  }, []);

  return (
    <SafeAreaView>
      <StatusBar barStyle={isDarkMode ? 'light-content' : 'dark-content'} />
    </SafeAreaView>
  );
}

export default App;
