import { useEffect, useState } from 'react' import classNames from 'classnames' import { Helmet } from 'react-helmet' import { Button } from '@/components/ui' import { APP_NAME } from '@/constants/app.constant' import { ROUTES_ENUM } from '@/routes/route.constant' import { pollUntilServerReady } from '@/services/setup.service' import { useStoreState } from '@/store' /** * Uygulama konfigürasyonu alınamadığında gösterilir (tipik olarak veritabanı erişilemez * durumdayken). * * Kullanıcı bilinçli olarak kurulum sihirbazına yönlendirilmez — çalışan bir sistemde * geçici bir arıza kimseyi kurulum ekranına düşürmemeli. Bunun yerine durum açıkça * belirtilir, sunucu arka planda izlenir ve toparlandığı anda sayfa kendini yeniler. */ const ServiceUnavailable = () => { const isDark = useStoreState((state) => state.theme.mode) === 'dark' const [attempt, setAttempt] = useState(0) // Sunucu toparlandığında kullanıcının sayfayı elle yenilemesi gerekmesin. useEffect(() => { const cancel = pollUntilServerReady( () => window.location.reload(), (currentAttempt) => setAttempt(currentAttempt), ) return cancel }, []) return (
The application configuration could not be loaded. The server is running, but it cannot reach its database right now. Your data is not affected — the application will come back automatically once the database is available again.