fork download
  1. // App.js
  2. import React from 'react';
  3. import { NavigationContainer } from '@react-navigation/native';
  4. import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
  5. import { createStackNavigator } from '@react-navigation/stack';
  6.  
  7. // الشاشات الرئيسية
  8. const DailyTransactions = () => {
  9. const [transactions, setTransactions] = useState([]);
  10.  
  11. return (
  12. <View style={styles.container}>
  13. <Text style={styles.header}>المعاملات اليومية</Text>
  14. {/* نموذج إضافة معاملة جديدة */}
  15. <TransactionForm onSubmit={(transaction) => {
  16. setTransactions([...transactions, transaction]);
  17. }} />
  18.  
  19. {/* قائمة المعاملات */}
  20. <TransactionList data={transactions} />
  21. </View>
  22. );
  23. };
  24.  
  25. const Invoices = () => {
  26. const [invoices, setInvoices] = useState([]);
  27.  
  28. return (
  29. <View style={styles.container}>
  30. <Text style={styles.header}>الفواتير</Text>
  31. {/* نموذج إنشاء فاتورة جديدة */}
  32. <InvoiceForm onSubmit={(invoice) => {
  33. setInvoices([...invoices, invoice]);
  34. }} />
  35.  
  36. {/* قائمة الفواتير */}
  37. <InvoiceList data={invoices} />
  38. </View>
  39. );
  40. };
  41.  
  42. const ExpensesIncome = () => {
  43. return (
  44. <View style={styles.container}>
  45. <Text style={styles.header}>المصروفات والإيرادات</Text>
  46. {/* مخطط بياني للمصروفات والإيرادات */}
  47. <ExpenseIncomeChart />
  48.  
  49. {/* تفاصيل المصروفات والإيرادات */}
  50. <ExpenseIncomeDetails />
  51. </View>
  52. );
  53. };
  54.  
  55. const Reports = () => {
  56. return (
  57. <View style={styles.container}>
  58. <Text style={styles.header}>التقارير</Text>
  59. {/* قائمة التقارير المتاحة */}
  60. <ReportsList onGenerateReport={(type) => {
  61. generateReport(type);
  62. }} />
  63. </View>
  64. );
  65. };
  66.  
  67. // إعداد التنقل
  68. const Tab = createBottomTabNavigator();
  69. const Stack = createStackNavigator();
  70.  
  71. export default function App() {
  72. return (
  73. <NavigationContainer>
  74. <Tab.Navigator>
  75. <Tab.Screen
  76. name="المعاملات"
  77. component={DailyTransactions}
  78. />
  79. <Tab.Screen
  80. name="الفواتير"
  81. component={Invoices}
  82. />
  83. <Tab.Screen
  84. name="المصروفات والإيرادات"
  85. component={ExpensesIncome}
  86. />
  87. <Tab.Screen
  88. name="التقارير"
  89. component={Reports}
  90. />
  91. </Tab.Navigator>
  92. </NavigationContainer>
  93. );
  94. }
  95.  
  96. const styles = StyleSheet.create({
  97. container: {
  98. flex: 1,
  99. padding: 20,
  100. backgroundColor: '#fff',
  101. },
  102. header: {
  103. fontSize: 24,
  104. fontWeight: 'bold',
  105. marginBottom: 20,
  106. textAlign: 'right',
  107. },
  108. });
Success #stdin #stdout #stderr 0.01s 5276KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Error: near line 1: near "/": syntax error
Error: near line 3: near "import": syntax error
Error: near line 4: near "import": syntax error
Error: near line 5: near "import": syntax error
Error: near line 7: near "/": syntax error
Error: near line 11: near "return": syntax error
Error: near line 17: unrecognized token: "}"
Error: near line 23: unrecognized token: "}"
Error: near line 25: near "const": syntax error
Error: near line 28: near "return": syntax error
Error: near line 34: unrecognized token: "}"
Error: near line 40: unrecognized token: "}"
Error: near line 42: near "const": syntax error
Error: near line 53: unrecognized token: "}"
Error: near line 55: near "const": syntax error
Error: near line 62: unrecognized token: "}"
Error: near line 65: unrecognized token: "}"
Error: near line 67: near "/": syntax error
Error: near line 69: near "const": syntax error
Error: near line 71: near "export": syntax error
Error: near line 94: unrecognized token: "}"