class ErrorBoundary extends React.Component { constructor(props) { super(props); this.state = { hasError: false, error: null }; } static getDerivedStateFromError(error) { return { hasError: true, error }; } componentDidCatch(error, errorInfo) { console.error('ErrorBoundary caught an error:', error, errorInfo.componentStack); } render() { if (this.state.hasError) { return (

حدث خطأ غير متوقع

نعتذر، واجهنا مشكلة تقنية.

); } return this.props.children; } } function App() { try { const [isDark, setIsDark] = React.useState(false); React.useEffect(() => { if (isDark) { document.documentElement.classList.add('dark'); } else { document.documentElement.classList.remove('dark'); } }, [isDark]); const toggleDark = () => setIsDark(!isDark); const posts = [ { id: 1, title: "شرح شامل: كيف تبني تطبيق ويب باستخدام React و Tailwind", excerpt: "في هذا المقال سنتعرف على الخطوات الأساسية لبناء تطبيق ويب عصري وسريع بخطوات مبسطة...", category: "برمجة وتطوير", date: "23 أبريل 2026", image: "https://images.unsplash.com/photo-1633356122544-f134324a6cee?ixlib=rb-4.0.3&auto=format&fit=crop&w=800&q=80" }, { id: 2, title: "تسريبات جديدة تكشف عن تصميم نظارة الواقع المختلط القادمة", excerpt: "ظهرت تسريبات حديثة توضح تصاميم مذهلة للجيل القادم من نظارات الواقع الافتراضي والمختلط...", category: "أجهزة ذكية", date: "22 أبريل 2026", image: "https://images.unsplash.com/photo-1622979135225-d2ba269cf1ac?ixlib=rb-4.0.3&auto=format&fit=crop&w=800&q=80" }, { id: 3, title: "السيارات ذاتية القيادة: هل نحن مستعدون للمستقبل؟", excerpt: "نظرة عميقة على تقنيات القيادة الذاتية والتحديات القانونية والأخلاقية التي تواجهها...", category: "تكنولوجيا السيارات", date: "20 أبريل 2026", image: "https://images.unsplash.com/photo-1549317661-bd32c8ce0db2?ixlib=rb-4.0.3&auto=format&fit=crop&w=800&q=80" }, { id: 4, title: "أفضل الحواسيب المحمولة للمبرمجين في عام 2026", excerpt: "قائمة شاملة بأفضل الأجهزة المحمولة التي تلبي احتياجات المطورين من حيث الأداء وقوة البطارية...", category: "مراجعات", date: "19 أبريل 2026", image: "https://images.unsplash.com/photo-1496181133206-80ce9b88a853?ixlib=rb-4.0.3&auto=format&fit=crop&w=800&q=80" } ]; return (
{/* Main Content */}

أحدث المقالات

{posts.map(post => ( ))}
{/* Sidebar */}
); } catch (error) { console.error('App component error:', error); return null; } } const root = ReactDOM.createRoot(document.getElementById('root')); root.render( );