import { cookies, headers } from 'next/headers' import { redirect } from 'next/navigation' import { resolveServerAppUrl } from '@/lib/appUrls' export default async function AdminLoginPage() { const requestHeaders = await headers() const cookieStore = await cookies() const rawTheme = cookieStore.get('rentaldrivego-theme')?.value const theme = rawTheme === 'light' ? 'light' : 'dark' const websiteUrl = resolveServerAppUrl( process.env.NEXT_PUBLIC_WEBSITE_URL ?? 'http://localhost:3000', requestHeaders.get('host'), requestHeaders.get('x-forwarded-proto'), ) redirect(`${websiteUrl}/en/${theme}/admin-sign-in?next=/admin/dashboard`) }